angular2-custom-pipes

    1熱度

    1回答

    我想根據employeemale.ts組件男性和女性定製的管道,當我在ngfor循環使用女性定製管道過濾數據就說明根據女性的數據: 作品: <ng-container *ngFor="let empLists of empList | filterdata:'female'"> 但是當我使用它的人顯示所有的JSON數據 不起作用: <ng-container *ngFor="let empLi

    1熱度

    1回答

    在我的應用程序需要在全球範圍的自定義管道,我嘗試實現它下面angular pipe 但我看到總是這個錯誤 模板解析錯誤:管「formatdate」不能發現 formatdate.pipe import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'formatdate' }) export class

    1熱度

    1回答

    我想使用內置貨幣管道製作自定義貨幣管道。我想要使​​用的方式是{{ anyNumber | customCurrency }}.然後在我的customCurrency管道中,我想使用內置的貨幣管道。我可以根據某些邏輯確定參數到貨幣管道,並且不想指定區域設置和其他參數,例如{{anyNumber | currency:'USD':false:'1:0-0'}}。 import { Pipe, Pip

    1熱度

    1回答

    關於何時使用自定義的任何規則管道以及何時使用自定義組件? 這些可以成爲拇指規則嗎? 如果需要非純文本html,使用組件?啓發:https://stackoverflow.com/a/34504446/170451 如果有東西不是交互式(靜態輸出),使用管道? 文檔似乎並沒有回答這個問題直接:https://angular.io/docs/ts/latest/guide/pipes.html 能管被