In my angular 4 template I have a simple pipe with a boolean I toggle to check if a user has been created
<div *ngFor="let user of users | existingUser : existingUserToggleFlag">
above my data I have my ng-repeat counts like this :
<span> Total Users: {{users.length}}
<span> Existing : {(users | existingUser : true)?.length} </span>
<span> NON-Existing : {(users | existingUser : false)?.length} </span>
As you can see I pass in pipe's argument as a static falsy from the template. The template does not update though, it only update when I use the existingUserToggleFlag. I can get the length of those no problem:
<span> Existing : {(users | existingUser : existingUserToggleFlag)?.length} </span>
I'm assuming its the digest not kicking off, as I console log and it appears (first glance via console.log) that my pipe does not get triggered.
Set
users
and the pipe in parentheses as shown in the FlyingHeroesPipe sample.The interpolation in your
span
elements needs to be corrected to{{ .. }}
If this did not work, post your Pipe implementation.