From de47500c533c0569abf0e00d93f17f3c11425b3b Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Sun, 2 Sep 2018 11:53:17 +0800 Subject: [PATCH] =?UTF-8?q?docs(API):=20=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=20RouterOutlet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/translations/cn/api-plan.md | 2 +- packages/router/src/directives/router_outlet.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index 1e5ff71cb2..b70734ed9b 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -33,7 +33,7 @@ [x] | core/OnInit | 0.66 [x] | common/UpperCasePipe | 0.65 [x] | common/NgStyle | 0.60 -[ ] | router/RouterOutlet | 0.59 +[x] | router/RouterOutlet | 0.59 [ ] | forms/Validators | 0.59 [ ] | common/http/HttpHeaders | 0.56 [x] | core/Pipe | 0.52 diff --git a/packages/router/src/directives/router_outlet.ts b/packages/router/src/directives/router_outlet.ts index 77d6283fc8..3556211ffc 100644 --- a/packages/router/src/directives/router_outlet.ts +++ b/packages/router/src/directives/router_outlet.ts @@ -18,6 +18,8 @@ import {PRIMARY_OUTLET} from '../shared'; * * Acts as a placeholder that Angular dynamically fills based on the current router state. * + * 一个占位符,Angular 会根据当前的路由器状态动态填充它。 + * * ``` * * @@ -27,6 +29,8 @@ import {PRIMARY_OUTLET} from '../shared'; * A router outlet will emit an activate event any time a new component is being instantiated, * and a deactivate event when it is being destroyed. * + * 每当新组件实例化之后,路由出口就会发出一个激活事件;在销毁时则发出取消激活的事件。 + * * ``` * { if (!this.activated) throw new Error('Outlet is not activated'); @@ -105,6 +111,8 @@ export class RouterOutlet implements OnDestroy, OnInit { /** * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree + * + * `RouteReuseStrategy` 的指示,把以前分离的子树重新附加回来时调用 */ attach(ref: ComponentRef, activatedRoute: ActivatedRoute) { this.activated = ref;