The pipe ' ' could not be found angular2 custom pipe

后端 未结 9 1104
时光说笑
时光说笑 2020-11-27 14:33

I can\'t seem to fix this error. I have a search bar and an ngFor. I am trying to filter the array using a custom pipe like this:



        
9条回答
  •  無奈伤痛
    2020-11-27 14:55

    Note : Only if you are not using angular modules

    For some reason this is not in the docs but I had to import the custom pipe in the component

    import {UsersPipe} from './users-filter.pipe'
    
    @Component({
        ...
        pipes:      [UsersPipe]
    })
    

提交回复
热议问题