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 能管被