填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

@angular/router

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.

入口点

主要

@angular/router

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

次要

@angular/router/testing

Supplies a testing module for the Angular Router subsystem.

@angular/router/upgrade

Provides support for upgrading routing applications from Angular JS to Angular.

主入口点的导出

模块

RouterModule

添加路由器指令和服务提供商。

Adds router directives and providers.

ActivationEnd

An event triggered at the end of the activation part of the Resolve phase of routing.

ActivationStart

An event triggered at the start of the activation part of the Resolve phase of routing.

ChildActivationEnd

An event triggered at the end of the child-activation part of the Resolve phase of routing.

ChildActivationStart

An event triggered at the start of the child-activation part of the Resolve phase of routing.

ChildrenOutletContexts

Store contextual information about the children (= nested) RouterOutlet

DefaultUrlSerializer

A default implementation of the UrlSerializer.

GuardsCheckEnd

表示路由的守卫(Guard)阶段的结束。

An event triggered at the end of the Guard phase of routing.

GuardsCheckStart

表示路由的守卫(Guard)阶段的开始。

An event triggered at the start of the Guard phase of routing.

NavigationCancel

An event triggered when a navigation is canceled, directly or indirectly.

NavigationEnd

表示当导航成功结束时触发的事件。

An event triggered when a navigation ends successfully.

NavigationError

表示当导航出错时触发的事件。

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

NavigationStart

代表导航开始时触发的事件。

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

An event triggered at the end of the Resolve phase of routing.

ResolveStart

An event triggered at the the start of the Resolve phase of routing.

RouteConfigLoadEnd

表示当某个路由被惰性加载时触发的事件。

An event triggered when a route has been lazy loaded.

RouteConfigLoadStart

表示在惰性加载某个路由配置前触发的事件。

An event triggered before lazy loading a route configuration.

RouteReuseStrategy

Provides a way to customize when activated routes get reused.

Router

一个提供导航和操纵 URL 能力的 NgModule。

A service that provides navigation and URL manipulation capabilities.

RouterEvent

路由器相关事件的(而不是关于特定路由的)基类。对于任何指定的导航,RouterEvent 只会触发一次。

Base for events the router goes through, as opposed to events tied to a specific route. 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

表示当路由被识别出来时触发的事件。

An event triggered when routes are recognized.

Scroll

表示一个滚动事件。

An event triggered by scrolling.

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.

函数

convertToParamMap

Converts a Params instance to a ParamMap.

provideRoutes

Registers a DI provider for a set of routes.

结构

ActivatedRoute

包含与当前组件相关的路由信息。ActivatedRoute 也可用于遍历路由器的状态树。

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.

ActivatedRouteSnapshot

包含与当前组件相关的路由的当前瞬间信息。ActivatedRoute 也可用于遍历路由器的状态树。 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

一个接口,某些类可以实现它以扮演一个守卫,来决定该路由能否激活。 如果所有守卫都返回 true,就会继续导航。如果任何一个守卫返回了 false,就会取消导航。 如果任何一个守卫返回了 UrlTree,就会取消当前导航,并开始导航到这个守卫所返回的 UrlTree

Interface that a class can implement to be a guard deciding if a route can be activated. If all guards return true, navigation will continue. If any guard returns false, navigation will be cancelled. If any guard returns a UrlTree, current navigation will be cancelled and a new navigation will be kicked off to the UrlTree returned from the guard.

CanActivateChild

一个接口,某些类可以实现它以扮演一个守卫,来决定该路由的子路由能否激活。 如果所有守卫都返回 true,就会继续导航。如果任何一个守卫返回了 false,就会取消导航。 如果任何一个守卫返回了 UrlTree,就会取消当前导航,并开始导航到这个守卫所返回的 UrlTree

Interface that a class can implement to be a guard deciding if a child route can be activated. If all guards return true, navigation will continue. If any guard returns false, navigation will be cancelled. If any guard returns a UrlTree, current navigation will be cancelled and a new navigation will be kicked off to the UrlTree returned from the guard.

CanDeactivate

一个接口,某些类可以实现它以扮演一个守卫,来决定该路由能否停用。 如果所有守卫都返回 true,就会继续导航。如果任何一个守卫返回了 false,就会取消导航。 如果任何一个守卫返回了 UrlTree,就会取消当前导航,并开始导航到这个守卫所返回的 UrlTree

Interface that a class can implement to be a guard deciding if a route can be deactivated. If all guards return true, navigation will continue. If any guard returns false, navigation will be cancelled. If any guard returns a UrlTree, current navigation will be cancelled and a new navigation will be kicked off to the UrlTree returned from the guard.

CanLoad

一个接口,某些类可以实现它以扮演一个守卫,来决定该路由的子路由能否加载。

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

ExtraOptions

表示路由器的配置项。

A set of configuration options for a router module, provided in the forRoot() method.

NavigationExtras

用于修订导航策略的额外选项。

Options that modify the navigation strategy.

ParamMap

A map that provides access to the required and optional parameters specific to a route. The map supports retrieving a single value with get() or multiple values with getAll().

Resolve

一个接口,某些类可以实现它以扮演一个数据提供者。

Interface that classes can implement to be a data provider. A data provider class can be used with the router to resolve data during navigation. The interface defines a resolve() method that will be invoked when the navigation starts. The router will then wait for the data to be resolved before the route is finally activated.

Route

A configuration object that defines a single route. A set of routes are collected in a Routes array to define a Router configuration. The router attempts to match segments of a given URL against each route, using the configuration options defined in this object.

RouterState

Represents the state of the router as a tree of activated routes.

RouterStateSnapshot

表示路由器在当前瞬间的状态。

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

UrlTree

Represents the parsed URL.

指令

RouterLink

让你可以在应用中链接到特定的路由。

Lets you link to specific routes in your app.

RouterLinkActive

当此链接指向的路由激活时,往宿主元素上添加一个 CSS 类。

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

一个占位符,Angular 会根据当前的路由器状态动态填充它。

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

类型

Data

Represents static data associated with a particular route.

DeprecatedLoadChildren

已废弃: the string form of loadChildren is deprecated in favor of the proposed ES dynamic import() expression, which offers a more natural and standards-based mechanism to dynamically load an ES module at runtime.

A string of the form path/to/file#exportName that acts as a URL for a set of routes to load.

DetachedRouteHandle

Represents the detached route tree.

Event

路由器事件能让你跟踪路由器的生命周期。

Router events that allow you to track the lifecycle of the router.

InitialNavigation

Allowed values in an ExtraOptions object that configure when the router performs the initial navigation operation.

LoadChildren

A string of the form path/to/file#exportName that acts as a URL for a set of routes to load, or a function that returns such a set.

LoadChildrenCallback

A function that is called to resolve a collection of lazy-loaded routes.

Navigation

Information about a navigation operation. Retrieve the most recent navigation object with the router.getCurrentNavigation() method.

PRIMARY_OUTLET

The primary routing outlet.

Params

A collection of matrix and query URL parameters.

QueryParamsHandling

How to handle query parameters in a router link. One of:

  • merge : Merge new with current parameters.
  • preserve : Preserve current parameters.
ROUTER_CONFIGURATION

DI 用它来配置路由器。

A DI token for the router service.

ROUTER_INITIALIZER

一个代表路由器初始化器的令牌,应用引导完毕后就会调用它。

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

ROUTES

The DI token for a router configuration.

ResolveData

Represents the resolved data associated with a particular route.

Routes

Represents a route configuration for the Router service. An array of Route objects, used in Router.config and for nested route configurations in Route.children.

RunGuardsAndResolvers

A policy for when to run guards and resolvers on a route.

UrlMatchResult

表示使用自定义匹配函数时的 URL 匹配结果。

Represents the result of matching URLs with a custom matching function.

UrlMatcher

一个用于匹配路由和 URL 的函数。 当 pathpathMatch 的组合不足以表达时,可以为 Route.matcher 实现一个自定义的 URL 匹配器。

A function for matching a route against URLs. Implement a custom URL matcher for Route.matcher when a combination of path and pathMatch is not expressive enough. Cannot be used together with path and pathMatch.