app.component.ts
import { Component, ViewChild } from ‘@angular/core’;
import { Platform, Nav } from ‘ionic-angular’;
import { StatusBar, Geolocation, Splashscreen } from ‘ionic-native’;
import {MyPage1} from ‘…/pages/page1/index/index/’;
import {MyPage2} from ‘…/pages/page2/index/index/’;
import {MyPage3} from ‘…/pages/page3/index/index/’;
import {MyPage4} from ‘…/pages/page4/index/index/’;
import {MyPage5} from ‘…/pages/page5/index/index/’;
import {MyPage6} from ‘…/pages/page61/index/index/’;
import {MyPage7} from ‘…/pages/page7/index/index/’;
import {MyPage8} from ‘…/pages/page8/index/index/’;
import {MyPage9} from ‘…/pages/page9/index/index/’;
import { TranslateService } from “ng2-translate/src/translate.service”;
import {Http} from ‘@angular/http’;
@Component({
template: <ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
,
})
export class MyApp {
rootPage: = MyPage1;
@ViewChild(Nav) nav: Nav;
constructor(platform: Platform, public translate: TranslateService, public http:Http) {
platform.ready().then(() => {
Splashscreen.hide();
StatusBar.styleDefault();
}
presentMyPage1(){
this.nav.setRoot(MyPage1);
}
presentMyPage2(){
this.nav.setRoot(MyPage2);
}
presentMyPage3(){
this.nav.setRoot(MyPage3);
}
}
app.module.ts
import { NgModule } from ‘@angular/core’;
import { IonicApp, IonicModule } from ‘ionic-angular’;
import { MyApp } from ‘./app.component’;
import {MyPage1} from ‘…/pages/page1/index/index/’;
import {MyPage2} from ‘…/pages/page2/index/index/’;
import {MyPage3} from ‘…/pages/page3/index/index/’;
import {MyPage4} from ‘…/pages/page4/index/index/’;
import {MyPage5} from ‘…/pages/page5/index/index/’;
import {MyPage6} from ‘…/pages/page61/index/index/’;
import {MyPage7} from ‘…/pages/page7/index/index/’;
import {MyPage8} from ‘…/pages/page8/index/index/’;
import {MyPage9} from ‘…/pages/page9/index/index/’;
@NgModule({
declarations: [
MyApp,
MyPage1,
…
],
imports: [
IonicModule.forRoot(MyApp),
],
bootstrap: [IonicApp],
entryComponents: [
MyPage1,
…
],
providers: []
})
export class AppModule {}
how to make the asyn boot, when many pages?
Please help me?