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:
Suggesting an alternative answer here:
Making a separate module for the Pipe is not required, but is definitely an alternative. Check the official docs footnote: https://angular.io/guide/pipes#custom-pipes
You use your custom pipe the same way you use built-in pipes.
You must include your pipe in the declarations array of the AppModule . If you choose to inject your pipe into a class, you must provide it in the providers array of your NgModule.
All you have to do is add your pipe to the declarations array, and the providers array in the module where you want to use the Pipe.
declarations: [
...
CustomPipe,
...
],
providers: [
...
CustomPipe,
...
]