博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Angular] Router outlet events
阅读量:6711 次
发布时间:2019-06-25

本文共 779 字,大约阅读时间需要 2 分钟。

For example, we have a component which just simply render router-outlet:

import { Component } from '@angular/core';@Component({  selector: 'mail-app',  styleUrls: ['mail-app.component.scss'],  template: `    
`})export class MailAppComponent {}
export const ROUTES: Routes = [  { path: 'folder/:name', component: MailFolderComponent }];

 

We can add events to router-outlet:

import { Component } from '@angular/core';@Component({  selector: 'mail-app',  styleUrls: ['mail-app.component.scss'],  template: `    
`})export class MailAppComponent { onActivate(event) { console.log(event) } onDeactivate(event) { console.log(event) }}

 

When we log out the, we see the actual component been rendered into the router-outlet.

转载地址:http://rkalo.baihongyu.com/

你可能感兴趣的文章
[leetcode]Search for a Range
查看>>
leetcode - Merge Intervals
查看>>
Freertos之系统配置
查看>>
四年前从这里开始,四年后从这里继续-回归博客园
查看>>
node.js的作用、回调、同步异步代码、事件循环
查看>>
深入学习虚拟机类加载过程
查看>>
WPF笔记(2.6 ViewBox)——Layout
查看>>
Linux命令--删除软连接
查看>>
Nginx 错误汇总
查看>>
Maven将jar包放入本地库
查看>>
SnowNLP:一个处理中文文本的 Python 类库
查看>>
linux系统性能监视命令
查看>>
iOS: 悬浮的条件筛选下拉框的使用
查看>>
2016 SDCC会后总结
查看>>
学习ASP.NET Core, 怎能不了解请求处理管道[6]: 管道是如何随着WebHost的开启被构建出来的?...
查看>>
Chrome浏览器插件推荐大全
查看>>
在现有的图像处理软件中融合dxf格式输出
查看>>
2016-2017-1 《信息安全系统设计基础》第十一周课程总结
查看>>
ChartControl 折线图 柱状图
查看>>
拖动滚动条时某一处相对另一处固定不动(position:fixed)
查看>>