diff --git a/ionic/components/nav/nav-controller.ts b/ionic/components/nav/nav-controller.ts index 91edc2d10e..8e23c4c7b9 100644 --- a/ionic/components/nav/nav-controller.ts +++ b/ionic/components/nav/nav-controller.ts @@ -1,4 +1,4 @@ -import {ComponentRef, Compiler, ElementRef, Injector, bind, NgZone, DynamicComponentLoader, AppViewManager} from 'angular2/angular2'; +import {Compiler, ElementRef, Injector, bind, NgZone, DynamicComponentLoader, AppViewManager} from 'angular2/angular2'; import {Ion} from '../ion'; import {makeComponent} from '../../config/decorators'; @@ -305,7 +305,7 @@ export class NavController extends Ion { * @param opts extra animation options */ popToRoot(opts = {}) { - this.popTo(this._views[0]); + this._popTo(this.first()); } /** @@ -542,7 +542,14 @@ export class NavController extends Ion { viewContainer.remove(index); } }; - return new ComponentRef(newLocation, component, type, null, dispose); + + // TODO: make-shift ComponentRef_, this is pretty much going to + // break in future versions of ng2, keep an eye on it + return { + location: newLocation, + instance: component, + dispose: dispose + }; } /** diff --git a/ionic/components/tabs/tabs.ts b/ionic/components/tabs/tabs.ts index 1d51a8318d..11c079f094 100644 --- a/ionic/components/tabs/tabs.ts +++ b/ionic/components/tabs/tabs.ts @@ -146,7 +146,7 @@ export class Tabs extends NavController { * TODO */ addTab(tab) { - this.add(tab.viewCtrl); + this._add(tab.viewCtrl); // return true/false if it's the initial tab return (this.length() === 1); diff --git a/ionic/config/decorators.ts b/ionic/config/decorators.ts index f53652a132..8bf56c3e38 100644 --- a/ionic/config/decorators.ts +++ b/ionic/config/decorators.ts @@ -125,17 +125,19 @@ export function App(args={}) { // get current annotations let annotations = Reflect.getMetadata('annotations', cls) || []; - // create @Component + // default to select args.selector = args.selector || 'ion-app'; - annotations.push(new Component(args)); - // create @View - // if no template was provided, default so it has a root ion-nav + // auto add Ionic directives + args.directives = args.directives ? args.directives.concat(IONIC_DIRECTIVES) : IONIC_DIRECTIVES; + + // if no template was provided, default so it has a root if (!args.templateUrl && !args.template) { args.template = ''; } - annotations.push(new PageImpl(args)); + // create @Component + annotations.push(new Component(args)); // redefine with added annotations Reflect.defineMetadata('annotations', annotations, cls); diff --git a/package.json b/package.json index d4b4796d9a..d40f6f4e99 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "link": "npm install && gulp src && npm link" }, "dependencies": { - "angular2": "2.0.0-alpha.39", + "angular2": "2.0.0-alpha.40", "@reactivex/rxjs": "0.0.0-prealpha.3", "reflect-metadata": "0.1.1", "zone.js": "0.5.8"