mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
app.stateClear() for setRoot()
This commit is contained in:
@@ -63,6 +63,10 @@ export class IonicApp {
|
||||
}
|
||||
}
|
||||
|
||||
stateClear() {
|
||||
this.router.stateClear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a known component with a key, for easy lookups later.
|
||||
*/
|
||||
|
||||
@@ -140,6 +140,8 @@ export class ViewController extends Ion {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
this.app.stateClear();
|
||||
|
||||
// if animate has not been set then default to false
|
||||
opts.animate = opts.animate || false;
|
||||
|
||||
|
||||
@@ -53,6 +53,12 @@ export class IonicRouter {
|
||||
}
|
||||
}
|
||||
|
||||
stateClear() {
|
||||
for (let name in stateManagers) {
|
||||
stateManagers[name].stateClear();
|
||||
}
|
||||
}
|
||||
|
||||
matchPaths(paths) {
|
||||
// load each of paths to a component
|
||||
let components = [];
|
||||
|
||||
@@ -96,6 +96,10 @@ class UrlStateManager {
|
||||
this._currentPath = null;
|
||||
}
|
||||
|
||||
stateClear() {
|
||||
this.paths([]);
|
||||
}
|
||||
|
||||
onLocationChange() {
|
||||
let currentPath = this.getCurrentPath();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user