From 00eced8a26db4d9060ad709175e952562e0dcd34 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Fri, 3 Jul 2015 14:02:19 -0500 Subject: [PATCH] fix nav mode --- ionic/components/nav/nav.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ionic/components/nav/nav.js b/ionic/components/nav/nav.js index 5afeba2b21..79e8a137ec 100644 --- a/ionic/components/nav/nav.js +++ b/ionic/components/nav/nav.js @@ -1,9 +1,10 @@ -import {Component, Directive, View, ElementRef, Parent, Optional, Injector, onInit, forwardRef} from 'angular2/angular2'; +import {Component, Directive, View, ElementRef, Parent, Optional, forwardRef, onInit, Injector} from 'angular2/angular2'; +import {IonicComponent} from '../../config/annotations'; import {ViewController} from '../view/view-controller'; -@Component({ +@IonicComponent({ selector: 'ion-nav', properties: [ 'root' @@ -12,7 +13,7 @@ import {ViewController} from '../view/view-controller'; }) @View({ template: '', - directives: [forwardRef(() => PaneAnchor)] + directives: [forwardRef(() => NavPaneAnchor)] }) export class Nav extends ViewController { @@ -25,15 +26,16 @@ export class Nav extends ViewController { } onInit() { - this.push(this.root); + if (this.root) { + this.push(this.root); + } } } -@Directive({ - selector: 'template[pane-anchor]' -}) -class PaneAnchor { + +@Directive({selector: 'template[pane-anchor]'}) +class NavPaneAnchor { constructor(@Parent() nav: Nav, elementRef: ElementRef) { nav.anchorElementRef(elementRef); }