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>

相關文章
相關標籤/搜索