angular 管道 和自定义管道示例
管道可以将数据格式化显示,而不改变源数据
一、angular管道
首先,进行Angular环境的搭建和项目创建
ctrl + c 结束服务
1、新建模块
ng g component components/home
如图:
2、将home模块添加到主页
app.component.html,页面代码如下,没有看错,只有一行
<app-home></app-home>
<
管道可以将数据格式化显示,而不改变源数据
首先,进行Angular环境的搭建和项目创建
ng g component components/home
如图:
app.component.html,页面代码如下,没有看错,只有一行
<app-home></app-home>
<