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

Filters match pipes

Angular 4 pipes are similar to what we use Filters for in Angular 1. Pipes provide the same formatting and transformation for data in the template. Almost all of the inbuilt filters that Angular 1 has correspond to pipes in Angular 4:

// Filter - Angular 1 
<td>{{movie.price | currency}}</td>

// Pipes in Angular 4
<td>{{movie.price | currency:'USD':true}}
</td>

Due to performance reasons, filter and orderBy filters have been removed from Pipes, although you can at anytime build a custom pipe if similar code is reused in multiple templates.

主站蜘蛛池模板: 金山区| 崇阳县| 阿荣旗| 扬州市| 达孜县| 苍溪县| 资源县| 韩城市| 信阳市| 上思县| 磴口县| 白沙| 清原| 那坡县| 琼海市| 舞钢市| 五寨县| 广平县| 德保县| 海兴县| 余干县| 灵武市| 常州市| 黔东| 连江县| 泸水县| 黑山县| 西充县| 台东县| 深水埗区| 新蔡县| 嘉义县| 阿拉善右旗| 庄浪县| 白城市| 金乡县| 嫩江县| 丹江口市| 威信县| 大英县| 沾化县|