I have made myself a custom pipe for filtering through my own objects, that is working properly when used with my dropdown selector. But I have noticed the filter gets run multiple times, by logging through the console everytime it runs.
Basic setup is a dropdown menu with elements, and then a list of objects that contain those elements. OnInit of my component I set the default selection for the dropdown. Any idea why my Filter will be running multiple times?
Even though it is working properly it is interfering with another filter because of it running multiple times.
If the pipe is pure (default) the pipe gets called when the input value or a parameter for the pipe has changed.
If the pipe is impure @Pipe({name: 'xxx', pure: false})
, then the pipe is called every time change detection runs (which is usually quite often).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With