官术网_书友最值得收藏!

Filters and pipes in templates

AngularJS filters are now called as pipes in Angular. The filters are used after the pipe character (|) in AngularJS and there is no syntactical change in Angular. However, Angular calls the filters as pipes.

AngularJS:

<h1>Book Details:</h1> 
<p>{{vm.bookName}}</p> 
<p>{{vm.releaseDate | date }}</p> 

Angular:

<h1>Book Details:</h1> 
<p>{{bookName}}</p> 
<p>{{releaseDate | date }}</p> 

Notice we have applied a date pipe or filter to releaseDate and there is no syntactical change between AngularJS and Angular.

主站蜘蛛池模板: 扬中市| 汤阴县| 肇源县| 定远县| 安陆市| 开鲁县| 宁城县| 马龙县| 安化县| 奇台县| 阳泉市| 曲松县| 临海市| 兴国县| 桃园县| 卫辉市| 武陟县| 石首市| 辉县市| 保山市| 昆明市| 深泽县| 东明县| 米泉市| 汉中市| 淳化县| 阿克陶县| 浦东新区| 南充市| 普兰县| 仲巴县| 陆丰市| 方城县| 长海县| 晋中市| 东乌| 平邑县| 湘西| 兴海县| 策勒县| 梓潼县|