RouterOutlet
一个占位符,Angular 会根据当前的路由器状态动态填充它。
Acts as a placeholder that Angular dynamically fills based on the current router state.
NgModule
选择器
属性
属性 | 说明 |
---|---|
@Output('activate') | |
@Output('deactivate') | |
isActivated: boolean | 只读 |
component: Object | 只读 |
activatedRoute: ActivatedRoute | 只读 |
activatedRouteData: Data | 只读 |
模板变量参考手册
标识符 | 用途 |
---|---|
outlet | #myTemplateVar="outlet" |
说明
Each outlet can have a unique name, determined by the optional name
attribute. The name cannot be set or changed dynamically. If not set, default value is "primary".
<router-outlet></router-outlet>
<router-outlet name='left'></router-outlet>
<router-outlet name='right'></router-outlet>
每当新组件实例化之后,路由出口就会发出一个激活事件;在销毁时则发出取消激活的事件。
A router outlet emits an activate event when a new component is instantiated, and a deactivate event when a component is destroyed.
<router-outlet
(activate)='onActivate($event)'
(deactivate)='onDeactivate($event)'></router-outlet>
方法
参数没有参数。 返回值
|
参数没有参数。 返回值
|
受 Called when the |
Called when the | ||||||
参数
|
参数没有参数。 返回值
|
参数
|