I am on an Ionic2 / Angular2 project. There I have a
*ngFor="let item of items | async | customPipe"
in my code. The async is because items is an Observable<Item[]>. My customPipe is working fine on the first run. But when I make any change to one if the items that would filter it out through my customPipe it is still shown.
What's the problem? Is the *ngFor only run once? Or do I have to force a DOM-update? Thanks for any help.
According to Angular2 pipe docs:
Reason:
So while you change your array or the elements inside the array, the arrays reference doesn't change.
So switching to
.onPushor triggering the change detection manually might solve your problem.Source: https://angular.io/docs/ts/latest/guide/pipes.html#!#pure-and-impure-pipes