What Is RouterState?
RouterState is interface and it represents the state of the router.
It looks like this.
interface RouterState extends Tree {
snapshot: RouterStateSnapshot
toString(): string
}
It is also a tree of activated routes.
We can access the current RouterState from anywhere in the Angular app using the Router service and the routerState property.
For
more detail kindly refer the link - https://www.code-sample.com/2018/05/angular-5-6-7-routing-and-navigation.html