pipe

slice管道,对数组进行截取,取值范围[a,b)

若是你数学基础还能够,[a,b)你应该知道是个什么状况
eg:json

[1,2,3,4,5]|slice(1,3) //2,3
[1,2,3,4,5]|slice(-3) //3,4,5
[1,2,3,4,5]|slice(-3,-1) //3,4

超出范围则When operating on a blank value, the pipe returns the blank value.数组

date

和angular.js使用方法同样async

json 同上

async 见rxjs章节

currency 返回的是$,通常不会用

percent和number用法同样

uppercase lowercase tittlecase

<p>{{"XiongWei"|uppercase}}</p>
<p>{{"XiongWei"|lowercase}}</p>
<p>{{"XiongWei"|titlecase}}</p>
<p>{{3.1415|number:'.2-2'}}</p>
<p>{{0.758|percent:'.2-2'}}</p>
<p>{{18.52|currency}}</p>

相关文章
相关标签/搜索