I am implementing a filtering operation on an array in Angular2. A pure pipe is not triggering when an element change in the array. Thus, I have to use either an impure pipe or make the filtering with a function inside of the component like below.
*ngFor="let item of items | impureFilterPipe"
Or,
<!-- component.html -->
*ngFor="let item of filterFunction(items)"
// component.ts
sortFunction(items) { return items.sort(); }
As I know, binding a function in the template is bad in the matter of performance. However, I can't see any difference of using an impure pipe instead of a function. What I am wondering is that are there any difference about the performance between these two approachs above?