@angular/router

入口点

主要

@angular/router

次要

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

导出列表

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.

GuardsCheckEnd

Represents the end of the Guard phase of routing.

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

GuardsCheckStart

Represents the start of the Guard phase of routing.

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

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.

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

ResolveEnd

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

表示路由解析(Resolve)阶段的结束。参见 ResolveStart 上的注释以了解这个试验性 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.

表示路由解析(Resolve)阶段的开始。该事件的触发时机将来可能会改变,因为它是试验性的。 在当前的迭代中,它将会在 resolve 阶段执行,而不管有没有东西要 resolve。 将来,这种行为可能会修改成只有当有东西要 resolve 时才执行。

RouteConfigLoadEnd

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

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

RouteConfigLoadStart

Represents an event triggered before lazy loading a route config.

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

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.

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

RoutesRecognized

Represents an event triggered when routes are recognized.

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

Scroll

Represents a scrolling event.

表示一个滚动事件。

RouteReuseStrategy

Provides a way to customize when activated routes get reused.

Router

Provides the navigation and url manipulation capabilities.

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

RouterModule

Adds router directives and providers.

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

ChildrenOutletContexts

Store contextual information about the children (= nested) RouterOutlet

OutletContext

Store contextual information about a RouterOutlet

NoPreloading

Provides a preloading strategy that does not preload any modules.

PreloadAllModules

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

PreloadingStrategy

Provides a preloading strategy.

RouterPreloader

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

UrlHandlingStrategy

Provides a way to migrate AngularJS applications to Angular.

DefaultUrlSerializer

A default implementation of the UrlSerializer.

UrlSegment

Represents a single URL segment.

UrlSegmentGroup

Represents the parsed URL segment group.

UrlSerializer

Serializes and deserializes a URL string into a URL tree.

函数

provideRoutes

Registers routes.

注册路由。

convertToParamMap

Convert a Params instance to a ParamMap.

结构

Route

See Routes for more details.

欲知详情,参见 Routes

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.

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

Resolve

Interface that class can implement to be a data provider.

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

NavigationExtras

Represents the extra options used during navigation.

表示在导航时用到的额外选项。

ExtraOptions

Represents options to configure the router.

表示路由器的配置项。

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.

包含与当前组件相关的路由信息。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.

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

RouterState

Represents the state of the router.

RouterStateSnapshot

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

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

ParamMap

Matrix and Query parameters.

矩阵参数(;)和查询参数(?)。

UrlTree

Represents the parsed URL.

指令

RouterLink

Lets you link to specific routes in your app.

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

RouterLinkWithHref

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.

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

RouterOutlet

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

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

类型

Data

Represents the static data associated with a particular route.

表示与特定路由相关的静态数据。

LoadChildren

The type of loadChildren.

loadChildren 的类型定义。

LoadChildrenCallback

The type of loadChildren.

loadChildren 的类型定义。

ResolveData

Represents the resolved data associated with a particular route.

表示与特定路由相关的解析出来的数据。

Routes

Represents router configuration.

表示路由器配置。

RunGuardsAndResolvers

The type of runGuardsAndResolvers.

runGuardsAndResolvers 的类型定义。

UrlMatchResult

Represents the results of the URL matching.

表示 URL 匹配的结果。

UrlMatcher

A function matching URLs

用于匹配 URL 的函数

Event

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

表示一个路由器事件,允许你跟踪路由器本身的生命周期。

DetachedRouteHandle

Represents the detached route tree.

ROUTES
ROUTER_CONFIGURATION

Is used in DI to configure the router.

DI 用它来配置路由器。

ROUTER_INITIALIZER

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

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

PRIMARY_OUTLET

Name of the primary outlet.

Params

A collection of parameters.