fix(router): routerLinkActive should only set classes after the router has successfully navigated
This commit is contained in:
@ -133,6 +133,13 @@ export class Router {
|
||||
private config: Routes;
|
||||
private configLoader: RouterConfigLoader;
|
||||
|
||||
/**
|
||||
* Indicates if at least one navigation happened.
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
navigated: boolean = false;
|
||||
|
||||
/**
|
||||
* Creates the router service.
|
||||
*/
|
||||
@ -385,6 +392,7 @@ export class Router {
|
||||
})
|
||||
.then(
|
||||
() => {
|
||||
this.navigated = true;
|
||||
this.routerEvents.next(
|
||||
new NavigationEnd(id, this.serializeUrl(url), this.serializeUrl(appliedUrl)));
|
||||
resolvePromise(navigationIsSuccessful);
|
||||
|
Reference in New Issue
Block a user