27自定义管道

①创建一个管道类文件   test.pipe.ts

  指定transform方法对于数据和参数的处理,将结果返回

②声明

  app.module.ts

  import {TestPipe} from   ' *** '

  @NgModule ( {

    declarations : [

      TestPipe

    ]

   } )

③调用自定义管道类

  用法和内置管道没有区别

原文地址:https://www.cnblogs.com/shanlu0000/p/12229621.html