app.stateClear() for setRoot()

This commit is contained in:
Adam Bradley
2015-07-17 10:37:22 -05:00
parent 0ba6d132a0
commit fe5ce7b8b8
4 changed files with 16 additions and 0 deletions

View File

@@ -63,6 +63,10 @@ export class IonicApp {
}
}
stateClear() {
this.router.stateClear();
}
/**
* Register a known component with a key, for easy lookups later.
*/

View File

@@ -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;

View File

@@ -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 = [];

View File

@@ -96,6 +96,10 @@ class UrlStateManager {
this._currentPath = null;
}
stateClear() {
this.paths([]);
}
onLocationChange() {
let currentPath = this.getCurrentPath();