fix(router): support guards navigating synchronously (#11150)

This commit is contained in:
Victor Savkin
2016-08-29 17:51:38 -07:00
committed by Victor Berchet
parent e8a1566065
commit e2241a2f92
2 changed files with 40 additions and 5 deletions

View File

@ -559,9 +559,12 @@ export class Router {
rejectPromise(ee);
}
}
this.currentRouterState = storedState;
this.currentUrlTree = storedUrl;
this.location.replaceState(this.serializeUrl(storedUrl));
if (id === this.navigationId) {
this.currentRouterState = storedState;
this.currentUrlTree = storedUrl;
this.location.replaceState(this.serializeUrl(storedUrl));
}
});
});
}