diff --git a/ionic/components/item/item.ts b/ionic/components/item/item.ts index a4c4d0c27a..5b2aa45f2c 100644 --- a/ionic/components/item/item.ts +++ b/ionic/components/item/item.ts @@ -1,4 +1,4 @@ -import {Component, ElementRef, Renderer} from 'angular2/angular2'; +import {Component} from 'angular2/angular2'; /** @@ -24,10 +24,13 @@ import {Component, ElementRef, Renderer} from 'angular2/angular2'; '' + '' + ''+ - '' + '', + host: { + '[class.item]': 'isItem' + } }) export class Item { - constructor(elementRef: ElementRef, renderer: Renderer) { - renderer.setElementClass(elementRef, 'item', true); + constructor() { + this.isItem = true; } } diff --git a/ionic/components/nav/nav-controller.ts b/ionic/components/nav/nav-controller.ts index 774dc8ed65..3a23dfa5a3 100644 --- a/ionic/components/nav/nav-controller.ts +++ b/ionic/components/nav/nav-controller.ts @@ -269,7 +269,6 @@ export class NavController extends Ion { return; } - opts.direction = opts.direction || 'back'; // get the views to auto remove without having to do a transiton for each @@ -452,7 +451,7 @@ export class NavController extends Ion { } // wait for the new view to complete setup - enteringView.stage(() => { + this.stage(enteringView, () => { if (enteringView.shouldDestroy) { // already marked as a view that will be destroyed, don't continue @@ -515,6 +514,30 @@ export class NavController extends Ion { } + /** + * @private + */ + stage(viewCtrl, done) { + if (viewCtrl.instance || viewCtrl.shouldDestroy) { + // already compiled this view + return done(); + } + + // get the pane the NavController wants to use + // the pane is where all this content will be placed into + this.loadPage(viewCtrl, null, () => { + + // this ViewController instance has finished loading + try { + viewCtrl.loaded(); + } catch (e) { + console.error(e); + } + + done(); + }); + } + loadPage(viewCtrl, navbarContainerRef, done) { let providers = this.providers.concat(Injector.resolve([ provide(ViewController, {useValue: viewCtrl}), diff --git a/ionic/components/nav/test/basic/index.ts b/ionic/components/nav/test/basic/index.ts index 6b6dcfa91f..9c2ce6f806 100644 --- a/ionic/components/nav/test/basic/index.ts +++ b/ionic/components/nav/test/basic/index.ts @@ -14,18 +14,24 @@ import {NavParams, NavController, ViewController} from 'ionic/ionic'; - -

{{title}}

-

-

-

-

-

-

-

-

-

- + + + + {{title}} + + + + + + + + + + + + + + ` }) class FirstPage { @@ -38,6 +44,11 @@ class FirstPage { this.title = 'First Page'; this.pushPage = FullPage; + + this.pages = []; + for (var i = 1; i <= 50; i++) { + this.pages.push(i); + } } setViews() { diff --git a/ionic/components/nav/view-controller.ts b/ionic/components/nav/view-controller.ts index 4fd539c9c2..02470fa1d3 100644 --- a/ionic/components/nav/view-controller.ts +++ b/ionic/components/nav/view-controller.ts @@ -15,32 +15,6 @@ export class ViewController { this._destroys = []; } - /** - * @private - */ - stage(done) { - let navCtrl = this.navCtrl; - - if (this.instance || !navCtrl || this.shouldDestroy) { - // already compiled this view - return done(); - } - - // get the pane the NavController wants to use - // the pane is where all this content will be placed into - navCtrl.loadPage(this, null, () => { - - // this ViewController instance has finished loading - try { - this.loaded(); - } catch (e) { - console.error(e); - } - - done(); - }); - } - /** * TODO * @returns {boolean} TODO