docs(API): 翻译完了 RouterOutlet
This commit is contained in:
parent
63127dd0c0
commit
de47500c53
|
@ -33,7 +33,7 @@
|
||||||
[x] | core/OnInit | 0.66
|
[x] | core/OnInit | 0.66
|
||||||
[x] | common/UpperCasePipe | 0.65
|
[x] | common/UpperCasePipe | 0.65
|
||||||
[x] | common/NgStyle | 0.60
|
[x] | common/NgStyle | 0.60
|
||||||
[ ] | router/RouterOutlet | 0.59
|
[x] | router/RouterOutlet | 0.59
|
||||||
[ ] | forms/Validators | 0.59
|
[ ] | forms/Validators | 0.59
|
||||||
[ ] | common/http/HttpHeaders | 0.56
|
[ ] | common/http/HttpHeaders | 0.56
|
||||||
[x] | core/Pipe | 0.52
|
[x] | core/Pipe | 0.52
|
||||||
|
|
|
@ -18,6 +18,8 @@ import {PRIMARY_OUTLET} from '../shared';
|
||||||
*
|
*
|
||||||
* Acts as a placeholder that Angular dynamically fills based on the current router state.
|
* Acts as a placeholder that Angular dynamically fills based on the current router state.
|
||||||
*
|
*
|
||||||
|
* 一个占位符,Angular 会根据当前的路由器状态动态填充它。
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
* <router-outlet></router-outlet>
|
* <router-outlet></router-outlet>
|
||||||
* <router-outlet name='left'></router-outlet>
|
* <router-outlet name='left'></router-outlet>
|
||||||
|
@ -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,
|
* 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.
|
* and a deactivate event when it is being destroyed.
|
||||||
*
|
*
|
||||||
|
* 每当新组件实例化之后,路由出口就会发出一个激活事件;在销毁时则发出取消激活的事件。
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
* <router-outlet
|
* <router-outlet
|
||||||
* (activate)='onActivate($event)'
|
* (activate)='onActivate($event)'
|
||||||
|
@ -93,6 +97,8 @@ export class RouterOutlet implements OnDestroy, OnInit {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the `RouteReuseStrategy` instructs to detach the subtree
|
* Called when the `RouteReuseStrategy` instructs to detach the subtree
|
||||||
|
*
|
||||||
|
* 受 `RouteReuseStrategy` 的指示,从子树中分离开时调用
|
||||||
*/
|
*/
|
||||||
detach(): ComponentRef<any> {
|
detach(): ComponentRef<any> {
|
||||||
if (!this.activated) throw new Error('Outlet is not activated');
|
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
|
* Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree
|
||||||
|
*
|
||||||
|
* `RouteReuseStrategy` 的指示,把以前分离的子树重新附加回来时调用
|
||||||
*/
|
*/
|
||||||
attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute) {
|
attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute) {
|
||||||
this.activated = ref;
|
this.activated = ref;
|
||||||
|
|
Loading…
Reference in New Issue