mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Route emit
This commit is contained in:
@@ -18,6 +18,7 @@ export class Router {
|
||||
|
||||
if(routeParams !== false) {
|
||||
route.exec(this.buildRouteParams(routeParams));
|
||||
this.emit(route.url)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -25,6 +26,10 @@ export class Router {
|
||||
return this.noMatch();
|
||||
}
|
||||
|
||||
emit(path) {
|
||||
window.location.hash = path
|
||||
}
|
||||
|
||||
buildRouteParams(routeParams) {
|
||||
routeParams._route = {
|
||||
path: window.location.hash.slice(1)
|
||||
@@ -50,6 +55,7 @@ export class Router {
|
||||
if((routeParams = route.match(path)) !== false) {
|
||||
console.log('OTHERWISE: route matched:', route.url);
|
||||
route.exec(routeParams)
|
||||
this.emit(route.url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user