diff --git a/ionic/components/nav/nav-controller.ts b/ionic/components/nav/nav-controller.ts index 185cb06a8b..75788e75bd 100644 --- a/ionic/components/nav/nav-controller.ts +++ b/ionic/components/nav/nav-controller.ts @@ -456,8 +456,11 @@ export class NavController extends Ion { enteringView.shouldDestroy = false; enteringView.shouldCache = false; - enteringView.willEnter(); - leavingView.willLeave(); + + if (!opts.preload) { + enteringView.willEnter(); + leavingView.willLeave(); + } // set that the new view pushed on the stack is staged to be entering/leaving // staged state is important for the transition to find the correct view @@ -490,8 +493,10 @@ export class NavController extends Ion { // dispose any views that shouldn't stay around transAnimation.dispose(); - enteringView.didEnter(); - leavingView.didLeave(); + if (!opts.preload) { + enteringView.didEnter(); + leavingView.didLeave(); + } // all done! this._zone.run(() => { @@ -536,7 +541,9 @@ export class NavController extends Ion { provide(NavParams, {useValue: viewCtrl.params}) ])); + console.time('loadPage ' + viewCtrl.componentType.name + ': loadIntoLocation'); this._loader.loadIntoLocation(viewCtrl.componentType, this.elementRef, 'contents', providers).then(componentRef => { + console.timeEnd('loadPage ' + viewCtrl.componentType.name + ': loadIntoLocation'); viewCtrl.addDestroy(() => { componentRef.dispose(); @@ -555,7 +562,10 @@ export class NavController extends Ion { let navbarTemplateRef = viewCtrl.getNavbarTemplateRef(); if (navbarContainerRef && navbarTemplateRef) { + + console.time('loadPage ' + viewCtrl.componentType.name + ': createEmbeddedView'); let navbarView = navbarContainerRef.createEmbeddedView(navbarTemplateRef); + console.timeEnd('loadPage ' + viewCtrl.componentType.name + ': createEmbeddedView'); viewCtrl.addDestroy(() => { let index = navbarContainerRef.indexOf(navbarView); diff --git a/ionic/config/decorators.ts b/ionic/config/decorators.ts index dc991505ad..a6e5e5c7ff 100644 --- a/ionic/config/decorators.ts +++ b/ionic/config/decorators.ts @@ -118,8 +118,7 @@ export function App(args={}) { // get current annotations let annotations = Reflect.getMetadata('annotations', cls) || []; - // default to select - args.selector = args.selector || 'ion-app'; + args.selector = 'ion-app'; // auto add Ionic directives args.directives = args.directives ? args.directives.concat(IONIC_DIRECTIVES) : IONIC_DIRECTIVES; @@ -135,7 +134,10 @@ export function App(args={}) { // redefine with added annotations Reflect.defineMetadata('annotations', annotations, cls); - bootstrap(cls, ionicProviders(args.config)); + console.time('bootstrap'); + bootstrap(cls, ionicProviders(args.config)).then(() => { + console.timeEnd('bootstrap'); + }); return cls; } diff --git a/scripts/e2e/e2e.template.html b/scripts/e2e/e2e.template.html index 20d03ade09..3a68b06727 100644 --- a/scripts/e2e/e2e.template.html +++ b/scripts/e2e/e2e.template.html @@ -7,6 +7,14 @@