Router

Stable

Class

What it does

Provides the navigation and url manipulation capabilities.

See Routes for more details and examples.

Class Overview

class Router {
constructor(rootComponentType: Type<any>, urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Routes)

errorHandler : ErrorHandler
navigated : boolean
urlHandlingStrategy : UrlHandlingStrategy
routeReuseStrategy : RouteReuseStrategy
config : Routes
initialNavigation() : void
setUpLocationChangeListener() : void
routerState : RouterState
url : string
events : Observable<Event>
resetConfig(config: Routes) : void
ngOnDestroy()
dispose() : void
createUrlTree(commands: any[], {relativeTo, queryParams, fragment, preserveQueryParams, queryParamsHandling,}?: NavigationExtras) : UrlTree
navigateByUrl(url: string|UrlTree, extras?: NavigationExtras) : Promise<boolean>
navigate(commands: any[], extras?: NavigationExtras) : Promise<boolean>
serializeUrl(url: UrlTree) : string
parseUrl(url: string) : UrlTree
isActive(url: string|UrlTree, exact: boolean) : boolean

}

Class Description

Constructor

constructor(rootComponentType: Type<any>, urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Routes)

Creates the router service.

Class Details

exported from router/index, defined in router/src/router.ts