fix(navController): fix this.add and _popTo ref

This commit is contained in:
Adam Bradley
2015-10-09 00:16:25 -05:00
parent 72ad5c1fb5
commit 17f64370fd
2 changed files with 11 additions and 4 deletions

View File

@ -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
};
}
/**