Posted On: Feb 22, 2018
RouterState is an interface which represents the state of the router as a tree of activated routes. Every node of this tree knows about the "consumed" URL segments, the extracted parameters, and the resolved data.
RouterState Interface looks like:
interface RouterState extends Tree { snapshot: RouterStateSnapshot toString(): string }
ActivatedRoute interface provides access to information about a route associated with a component that is loaded in an outlet. Use to traverse the RouterState tree and extract information from nodes.
ActivatedRoute Interface looks like
interface ActivatedRoute { snapshot: ActivatedRouteSnapshot url: Observable<UrlSegment[]> params: Observable queryParams: Observable fragment: Observable data: Observable outlet: string component: Type | string | null routeConfig: Route | null root: ActivatedRoute parent: ActivatedRoute | null firstChild: ActivatedRoute | null children: ActivatedRoute[] pathFromRoot: ActivatedRoute[] paramMap: Observable queryParamMap: Observable toString(): string }
Never Miss an Articles from us.
Angular 2 is a completely revived component-based framework in which an application is a tree of loosely coupled compon..
Angular 2 is a re-written version of Angular1 and not an update. The best way to compare Angular 2 and Angular 1 is by f..
Angular 2 is a platform that encompasses a wide range of capabilities. Some new features were added in Angular 2 which i..