refactor(tabs): support async loading

support async loading
This commit is contained in:
Dan Bucholtz
2017-03-02 15:01:42 -06:00
parent d5149313e6
commit a26b054a3f

View File

@@ -532,11 +532,14 @@ export class Tabs extends Ion implements AfterViewInit {
tab.popToRoot().catch(() => {
console.debug('Tabs: pop to root was cancelled');
});
} else if (getComponent(this._linker, tab.root) !== active.component) {
// Otherwise, if the page we're on is not our real root, reset it to our
// default root type
tab.setRoot(tab.root).catch(() => {
} else {
getComponent(this._linker, tab.root).then(viewController => {
if (viewController !== active.component) {
// Otherwise, if the page we're on is not our real root
// reset it to our default root type
return tab.setRoot(tab.root);
}
}).catch(() => {
console.debug('Tabs: reset root was cancelled');
});
}