[SOLVED]
Hello,
I’m having a hard time getting the updated variables to work with ngFor. I’m getting the variable worksavailable.available from a provider (this is updated by another provider - and it works). The issue I’m facing is that my ngFor card isn’t updating with the correct variable change.
I know I need to call this in the .ts file, but it doesn’t work with events (if I try a private variable). How do I get this to work.
Here’s the HTML.
<ion-content padding text-center>
<div *ngFor="let work of works">
<ion-card
[style.background-color]="worksavailable.available ? '#000000' : '#EE7600'"
(click)="goWorkDetails(work)"
detail-none>
<div class="myOverlay">
<img src="assets/imgs/headers/{{work.image}}">
<ion-card-header text-left *ngIf="!worksavailable.available" class="caption2">{{ work.id +'.title' | translate }}</ion-card-header>
<ion-card-header text-left *ngIf="worksavailable.available" class="caption">{{ work.id +'.title' | translate }}</ion-card-header>
<ion-icon class="lock" padding *ngIf="!availables" name="lock"></ion-icon>
<ion-icon class="lock" padding *ngIf="availables" name="unlock" color="primary"></ion-icon>
</div>
<ion-row>
<ion-card-content >
{{ work.id +'.name' | translate }}
</ion-card-content>
</ion-row>
</ion-card>
</div>
</ion-content>
The “availables” variable is the local one that’s still there due to testing.