日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

angular 管道

發布時間:2025/4/16 52 豆豆
生活随笔 收集整理的這篇文章主要介紹了 angular 管道 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
管道將數據作為輸入并將其轉換為所需的輸出(實現對數據的格式化)。

管道可以接受任意數量的可選參數來微調起輸出,要向管道添加參數,請使用冒號(:)跟隨管道名稱,然后使用參數值,如:date: "MM/dd/yy",如果管道接受多個參數,請用冒號分割值如:slice:1:5。

<p>The hero's birthday is {{ birthday | date:"MM/dd/yy"}}</p>birthday = new Date(1988, 3, 15);復制代碼

<p>The hero's birthday is {{ birthday | date:format }}</p><button (click)="toggleFormat()">Toggle Format</button> toggle = true; // start with true == shortDate get format() { return this.toggle ? 'shortDate' : 'fullDate'; } toggleFormat() { this.toggle = !this.toggle; }復制代碼

<p>The chained hero's birthday is{{ birthday | date:'fullDate' | uppercase}}</p>復制代碼


轉載于:https://juejin.im/post/5c86092df265da2dde072489

總結

以上是生活随笔為你收集整理的angular 管道的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。