Angular 5 Router Life Cycle Events

Angular 5 Router Life Cycle Events

Whenever the root navigations, the router emits navigation events using Router.events property.
The sequence of router events is -
1.      NavigationStart
2.      RouteConfigLoadStart
3.      RouteConfigLoadEnd
4.      RoutesRecognized
5.      GuardsCheckStart
6.      ChildActivationStart
7.      ActivationStart
8.      GuardsCheckEnd
9.      ResolveStart
10.  ResolveEnd
11.  ActivationEnd
12.  ChildActivationEnd
13.  NavigationEnd
14.  NavigationCancel
15.  NavigationError

The Router events are also logged in the console when enableTracing option is enabled.
The NavigationStart event is triggered when navigation starts.
The RoutesRecognized event triggered when the routes are recognized.
The RouteConfigLoadStart event triggered before the Router lazy loads.
The RouteConfigLoadEnd event triggered after a route has been lazily loaded.
The NavigationEnd event triggered when navigation ends successfully.
The NavigationCancel event triggered when navigation is canceled.

The NavigationError event triggered when router navigation fails due to an error.

Stayed Informed What’s New in Angular 5?

I hope you are enjoying with this post! Please share with you friends. Thank you so much!
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

Angular 5 Router Life Cycle Events Angular 5 Router Life Cycle Events Reviewed by Anil Singh on 2:53 AM Rating: (5)
www.code-sample.com/. Powered by Blogger.
^