1.

What are the router events?

Answer»

In Angular, during each navigation route, the Router sends navigation events through the Router Events property.

Here is the LIST of events range from when the navigation STARTS and ends too MANY points in between.

  • NavigationStart
  • RouteConfigLoadEnd
  • GuardsCheckStart
  • ActivationStart
  • GuardsCheckEnd
  • ResolveStart
  • ActivationEnd
  • NavigationEnd
Example

export class AppComponent {
   constructor(private router: Router) {
   }
   ngOnInit() {
      this.router.events
      .PIPE(filter(event => event instanceof NavigationEnd))
      .subscribe(() => {
         ...
       });
   }
}



Discussion

No Comment Found