Angular Ngclass/ngif Not Rerendering On Changes
I'm working on an Angular project where I need to have one class or another depending on a variable (and they have to change live, without refreshing). I tried using *ngIf/else and
Solution 1:
In your component, favSongs
never gets updated: it gets value assigned in the ngOnInit
(so, once in the lifetime of the component), and that's it. setToFav
only manipulates local storage (favSongs
doesn't automatically get updated, you have to to it explicitly).
Post a Comment for "Angular Ngclass/ngif Not Rerendering On Changes"