Reputation: 77
I would like to change the outline property of ionic-chip if an observable changes:
<span *ngIf="(avgRating | async) as obs">
<ion-chip outline= "obs.total > 0 ? 'none' : 'outline'">
// change outline property if observable changes
</ion-chip>
</span>
Is it possible to do this in the template file?
Upvotes: 0
Views: 475
Reputation: 201
The outline property of an ion-chip is a boolean value. Therefore, you cannot set 'none' or 'outline' to it as they are strings. Therefore, it would just be enough to check and return output of obs.total > 0 to the outline attribute.
Ref: https://ionicframework.com/docs/api/chip
Upvotes: 1