@angular/router

package

Implements the Angular Router service , which enables navigation from one view to the next as users perform application tasks.

Defines the Route object that maps a URL path to a component, and the RouterOutlet directive that you use to place a routed view in a template, as well as a complete API for configuring, querying, and controlling the router state.

Import RouterModule to use the Router service in your app. For more usage information, see the Routing and Navigation guide.

Entry points

Primary

@angular/router

Implements the Angular Router service , which enables navigation from one view to the next as users perform application tasks.

Secondary

@angular/router/testing
@angular/router/upgrade

Primary entry point exports

NgModules

RouterModule

Adds router directives and providers.

Classes

ActivationEnd

Represents the start of end of the Resolve phase of routing. See note on ActivationStart for use of this experimental API.

ActivationStart

Represents the start of end of the Resolve phase of routing. See note on ActivationEnd for use of this experimental API.

ChildActivationEnd

Represents the start of end of the Resolve phase of routing. See note on ChildActivationStart for use of this experimental API.

ChildActivationStart

Represents the start of end of the Resolve phase of routing. See note on ChildActivationEnd for use of this experimental API.

ChildrenOutletContexts

Store contextual information about the children (= nested) RouterOutlet

DefaultUrlSerializer

A default implementation of the UrlSerializer.

GuardsCheckEnd

Represents the end of the Guard phase of routing.

GuardsCheckStart

Represents the start of the Guard phase of routing.

NavigationCancel

Represents an event triggered when a navigation is canceled.

NavigationEnd

Represents an event triggered when a navigation ends successfully.

NavigationError

Represents an event triggered when a navigation fails due to an unexpected error.

NavigationStart

Represents an event triggered when a navigation starts.

NoPreloading

Provides a preloading strategy that does not preload any modules.

OutletContext

Store contextual information about a RouterOutlet

PreloadAllModules

Provides a preloading strategy that preloads all modules as quickly as possible.

PreloadingStrategy

Provides a preloading strategy.

ResolveEnd

Represents the end of the Resolve phase of routing. See note on ResolveStart for use of this experimental API.

ResolveStart

Represents the start of the Resolve phase of routing. The timing of this event may change, thus it's experimental. In the current iteration it will run in the "resolve" phase whether there's things to resolve or not. In the future this behavior may change to only run when there are things to be resolved.

RouteConfigLoadEnd

Represents an event triggered when a route has been lazy loaded.

RouteConfigLoadStart

Represents an event triggered before lazy loading a route config.

RouteReuseStrategy

Provides a way to customize when activated routes get reused.

Router

Provides the navigation and url manipulation capabilities.

RouterEvent

Base for events the Router goes through, as opposed to events tied to a specific Route. RouterEvents will only be fired one time for any given navigation.

RouterPreloader

The preloader optimistically loads all router configurations to make navigations into lazily-loaded sections of the application faster.

RoutesRecognized

Represents an event triggered when routes are recognized.

Scroll

Represents a scrolling event.

UrlHandlingStrategy

Provides a way to migrate AngularJS applications to Angular.

UrlSegment

Represents a single URL segment.

UrlSegmentGroup

Represents the parsed URL segment group.

UrlSerializer

Serializes and deserializes a URL string into a URL tree.

Functions

convertToParamMap

Convert a Params instance to a ParamMap.

provideRoutes

Registers routes.

Structures

ActivatedRoute

Contains the information about a route associated with a component loaded in an outlet. An ActivatedRoute can also be used to traverse the router state tree.

ActivatedRouteSnapshot

Contains the information about a route associated with a component loaded in an outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to traverse the router state tree.

CanActivate

Interface that a class can implement to be a guard deciding if a route can be activated.

CanActivateChild

Interface that a class can implement to be a guard deciding if a child route can be activated.

CanDeactivate

Interface that a class can implement to be a guard deciding if a route can be deactivated.

CanLoad

Interface that a class can implement to be a guard deciding if a children can be loaded.

ExtraOptions

Represents options to configure the router.

NavigationExtras

Represents the extra options used during navigation.

ParamMap

Matrix and Query parameters.

Resolve

Interface that class can implement to be a data provider.

Route

See Routes for more details.

RouterState

Represents the state of the router.

RouterStateSnapshot

Represents the state of the router at a moment in time.

UrlTree

Represents the parsed URL.

Directives

RouterLink

Lets you link to specific routes in your app.

RouterLinkActive

Lets you add a CSS class to an element when the link's route becomes active.

RouterLinkWithHref

Lets you link to specific routes in your app.

RouterOutlet

Acts as a placeholder that Angular dynamically fills based on the current router state.

Types

Data

Represents the static data associated with a particular route.

DetachedRouteHandle

Represents the detached route tree.

Event

Represents a router event, allowing you to track the lifecycle of the router.

LoadChildren

The type of loadChildren.

LoadChildrenCallback

The type of loadChildren.

PRIMARY_OUTLET

Name of the primary outlet.

Params

A collection of parameters.

ROUTER_CONFIGURATION

Is used in DI to configure the router.

ROUTER_INITIALIZER

A token for the router initializer that will be called after the app is bootstrapped.

ROUTES
ResolveData

Represents the resolved data associated with a particular route.

Routes

Represents router configuration.

RunGuardsAndResolvers

The type of runGuardsAndResolvers.

UrlMatchResult

Represents the results of the URL matching.

UrlMatcher

A function matching URLs

© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/router