Reputation: 1019
I have a PhoneGap mobile application that has a couple of predefined "html pages" (I used the double quotes, because they're not actual html files). I used the onsen-ui framework for it, so I can put all the "html" pages in ONE index.html file.
I create the pages like this:
<ons-template id="login.html">
<ons-page ng-controller="LoginController" id="login">
<ons-toolbar>
<div class="center">Log In</div>
</ons-toolbar>
<div class="login-form">
<input type="text" class="text-input--underbar" placeholder="Username" ng-model="email">
<input type="password" class="text-input--underbar" placeholder="Password" ng-model="password">
<br><br>
<ons-button modifier="large" class="login-button" ng-click="checkLogin(email,password)" > Log In</ons-button>
</div>
</ons-page>
</ons-template>
As you can see, I have a Controller connected to this page, called LoginController which is defined in the main.js javascript file, which is the engine of the whole application. In order to do / show anything in the view, it has to have a controller and functions defined.
Is it possible, to dynamically add these ons-template>ons-page> elements to the index.html file, from php, so we can "update" the app, without actually changing anything on the application? Also, this would probably only work if the main.js file is also updated with a new controller, or should it be a generic one?
The app is used for showing info from a database, and we would like to add new "views" dynamically, which would show different data from the database.
Upvotes: 0
Views: 79
Reputation: 4148
You might want to take a look at Microsoft's Code Push which is a plugin and server component designed to do update app content without an App Store update.
Upvotes: 0