27自定义管道

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

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

②声明

  app.module.ts

  import {TestPipe} from   ' *** '

  @NgModule ( {

    declarations : [

      TestPipe

    ]

   } )

③调用自定义管道类

  用法和内置管道没有区别

 

 

 

 

posted @ 2020-01-22 20:53  shanlu  阅读(199)  评论(0编辑  收藏  举报