mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(navController): fix this.add and _popTo ref
This commit is contained in:
@ -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 {Ion} from '../ion';
|
||||||
import {makeComponent} from '../../config/decorators';
|
import {makeComponent} from '../../config/decorators';
|
||||||
@ -305,7 +305,7 @@ export class NavController extends Ion {
|
|||||||
* @param opts extra animation options
|
* @param opts extra animation options
|
||||||
*/
|
*/
|
||||||
popToRoot(opts = {}) {
|
popToRoot(opts = {}) {
|
||||||
this.popTo(this._views[0]);
|
this._popTo(this.first());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -542,7 +542,14 @@ export class NavController extends Ion {
|
|||||||
viewContainer.remove(index);
|
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
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -146,7 +146,7 @@ export class Tabs extends NavController {
|
|||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
addTab(tab) {
|
addTab(tab) {
|
||||||
this.add(tab.viewCtrl);
|
this._add(tab.viewCtrl);
|
||||||
|
|
||||||
// return true/false if it's the initial tab
|
// return true/false if it's the initial tab
|
||||||
return (this.length() === 1);
|
return (this.length() === 1);
|
||||||
|
Reference in New Issue
Block a user