I created a very simple simulator of my app in my landing page website. The way i do it locally is in the index.html of my landing page i run (ionic serve) the app through an iframe like this:
<iframe src="http://localhost:8100/#/tab/home"></iframe>
My problem is how do I reference the source when i upload it in my web hosting.
my file structure looks like this
x myLandingPage
>index.html //landing page
x mysimulator
x www
x templates
>index.html //ionic app
edit: Ionic 1.2 officially supports deployment as a website!
Let's assume your site is hosted at
example.com
domain and that you have a folder calledmyLandingPage
at the root of your server and that you can access it online viahttp://example.com/myLandingPage/index.html
. In that case you would use the followingiframe
tag in yourindex.html
file:So, once you upload your app to your hosting, you won't have to run
ionic serve
, because when you do that locally you actually start a local web server which then serves this content. Once you upload your files to your server that step is then of course not needed.Hope this helps. Btw, I see one thing that looks a bit off from the standard Ionic setting and that is the placement of your index.html file inside the templates folder. Usually it is in the www folder. So, in case you misplaced the file in the file structure it could be that the src will be
but I hope you get the point and will be able to find your way.