docs(API): 翻译完了 RouterOutlet

This commit is contained in:
Zhicheng Wang 2018-09-02 11:53:17 +08:00
parent 63127dd0c0
commit de47500c53
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -18,6 +18,8 @@ import {PRIMARY_OUTLET} from '../shared';
*
* Acts as a placeholder that Angular dynamically fills based on the current router state.
*
* Angular
*
* ```
* <router-outlet></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,
* and a deactivate event when it is being destroyed.
*
*
*
* ```
* <router-outlet
* (activate)='onActivate($event)'
@ -93,6 +97,8 @@ export class RouterOutlet implements OnDestroy, OnInit {
/**
* Called when the `RouteReuseStrategy` instructs to detach the subtree
*
* `RouteReuseStrategy`
*/
detach(): ComponentRef<any> {
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<any>, activatedRoute: ActivatedRoute) {
this.activated = ref;