diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index d72e79bcab..3b6ab455c0 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -57,7 +57,7 @@ [x] | core/Output | 0.33 [x] | common/http/HttpInterceptor | 0.30 [x] | common/http/HttpRequest | 0.29 -[ ] | router/CanActivate | 0.27 +[x] | router/CanActivate | 0.27 [ ] | router | 0.26 [ ] | animations/style | 0.25 [ ] | common/SlicePipe | 0.25 diff --git a/packages/router/src/interfaces.ts b/packages/router/src/interfaces.ts index 1d10033c04..30d2d7f47f 100644 --- a/packages/router/src/interfaces.ts +++ b/packages/router/src/interfaces.ts @@ -17,6 +17,8 @@ import {ActivatedRouteSnapshot, RouterStateSnapshot} from './router_state'; * * Interface that a class can implement to be a guard deciding if a route can be activated. * + * 一个接口,某些类可以实现它以扮演一个守卫,来决定该路由能否激活。 + * * ``` * class UserToken {} * class Permissions { @@ -54,6 +56,8 @@ import {ActivatedRouteSnapshot, RouterStateSnapshot} from './router_state'; * * You can alternatively provide a function with the `canActivate` signature: * + * 你还可以转而实现一个带有 `canActivate` 签名的函数: + * * ``` * @NgModule({ * imports: [ @@ -87,6 +91,8 @@ export interface CanActivate { * * Interface that a class can implement to be a guard deciding if a child route can be activated. * + * 一个接口,某些类可以实现它以扮演一个守卫,来决定该路由的子路由能否激活。 + * * ``` * class UserToken {} * class Permissions { @@ -129,6 +135,8 @@ export interface CanActivate { * * You can alternatively provide a function with the `canActivateChild` signature: * + * 你还可以转而提供一个具有 `canActivateChild` 签名的函数: + * * ``` * @NgModule({ * imports: [ @@ -167,6 +175,8 @@ export interface CanActivateChild { * * Interface that a class can implement to be a guard deciding if a route can be deactivated. * + * 一个接口,某些类可以实现它以扮演一个守卫,来决定该路由能否停用。 + * * ``` * class UserToken {} * class Permissions { @@ -206,6 +216,8 @@ export interface CanActivateChild { * * You can alternatively provide a function with the `canDeactivate` signature: * + * 你还可以转而提供具有 `canDeactivate` 签名的函数: + * * ``` * @NgModule({ * imports: [ @@ -241,6 +253,8 @@ export interface CanDeactivate { * * Interface that class can implement to be a data provider. * + * 一个接口,某些类可以实现它以扮演一个数据提供者。 + * * ``` * class Backend { * fetchTeam(id: string) { @@ -279,6 +293,8 @@ export interface CanDeactivate { * * You can alternatively provide a function with the `resolve` signature: * + * 你还可以转而提供一个具有 `resolve` 签名的函数: + * * ``` * @NgModule({ * imports: [ @@ -313,6 +329,8 @@ export interface Resolve { * * Interface that a class can implement to be a guard deciding if a children can be loaded. * + * 一个接口,某些类可以实现它以扮演一个守卫,来决定该路由的子路由能否加载。 + * * ``` * class UserToken {} * class Permissions { @@ -348,6 +366,8 @@ export interface Resolve { * * You can alternatively provide a function with the `canLoad` signature: * + * 你还可以转而提供一个具有 `canLoad` 签名的函数: + * * ``` * @NgModule({ * imports: [