What Is Impure Pipe?
Angular executes an impure pipe during every component change detection cycle. An impure pipe is called often, as often as every keystroke or mouse-move.
If you want to make a pipe impure that time you will allow the setting pure flag to false.
@Pipe({
name: 'currency',
pure:false
})
The example for impure pipe –
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'currency',
pure:false
})
export class CurrencyPipe implements PipeTransform {
transform(value: any, args?: any): any {
if (!value) {
return '1.00';
}
return value;
}
}
https://www.code-sample.com/2018/05/angular-5-6-7-pipes-decorator.html