This has the following example of getting a NavigationEnd from the Router (where both things import from @angular/router):
this.router.events
.subscribe((event) => {
if (event instanceof NavigationEnd) {
console.log('NavigationEnd:', event);
}
});
NavigationEnd is an event that happens at the end of a navigation. It is a late-in-the-lifecycle lifecycle event for routing.
No comments:
Post a Comment