I am working with Angular 2 and I have to create search filter. So I created a pipe with search logic and injected it in desired component. But while injecting, I am getting error.
This is code where i am injecting pipe,
import { FilterPipe} from '../filter.pipe'; @Component({ selector: 'app-dialog', templateUrl: './dialog.component.html', pipes: [FilterPipe], styleUrls: ['./dialog.component.css'] }) This is an error,
Argument of type '{ selector: string; templateUrl: string; pipes: typeof FilterPipe[]; styleUrls: string[]; }' is not assignable to parameter of type 'Component'. Object literal may only specify known properties, and 'pipes' does not exist in type 'Component'. Please anyone, suggest me how to add pipe in component.