angularjs - How can I create a login page using Ionic 2 framework that then leads to a tabbed view? -
currenty, in app.html
file, have:
<ion-tabs> <ion-tab [root]="tab1root" tabtitle="tab1" tabicon="time"></ion-tab> <ion-tab [root]="tab2root" tabtitle="tab2" tabicon="paper"></ion-tab> <ion-tab [root]="tab3root" tabtitle="tab3" tabicon="more"></ion-tab> </ion-tabs>
and in app.js
file, after doing proper imports of these pages, have:
this.tab1root = page1; this.tab2root = page2; this.tab3root = page3;
i want application open login page, , there progress tabbed view. i'm not sure how logically set in context of app.html
, app.js
i'm interested in answers involving ionic 2 (and angular 2.0), not older versions.
in app, define this:
export class yourapp { rootpage: type = loginpage; constructor(app: ionicapp, platform: platform) { platform.ready().then(() => { }); } }
in loginpage, should have this:
export class loginpage { constructor(nav: navcontroller) { this.nav = nav; } dologin() { if (loginsuccessful) { this.nav.setroot(yourtabspage); } } }
Comments
Post a Comment