mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
test(tabs): use setRoot to log out
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import {RouteConfig, Location} from 'angular2/router';
|
import {RouteConfig, Location} from 'angular2/router';
|
||||||
|
|
||||||
import {App, Page, NavController, Keyboard} from 'ionic/ionic';
|
import {App, Page, NavController} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
@ -26,15 +26,12 @@ import {App, Page, NavController, Keyboard} from 'ionic/ionic';
|
|||||||
`
|
`
|
||||||
})
|
})
|
||||||
class SignIn {
|
class SignIn {
|
||||||
constructor(nav: NavController, keyboard: Keyboard) {
|
constructor(nav: NavController) {
|
||||||
this.nav = nav;
|
this.nav = nav;
|
||||||
this.keyboard = keyboard;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
push() {
|
push() {
|
||||||
setTimeout(() => {
|
this.nav.push(TabsPage);
|
||||||
this.nav.push(TabsPage);
|
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +75,7 @@ class Tab1Page1 {
|
|||||||
logout() {
|
logout() {
|
||||||
let tabs = this.nav.parent;
|
let tabs = this.nav.parent;
|
||||||
let rootNav = tabs.parent;
|
let rootNav = tabs.parent;
|
||||||
rootNav.pop();
|
rootNav.setRoot(SignIn, null, { animate: true, direction: 'back' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user