Closed 32x0lf closed 1 year ago
you use prop visible
array with index 0
for all your alerts
I'd rather use index variable with *ngFor
<c-alert *ngFor="let data of notifications; index as idx"
[visible]="visible[idx]"
...
>
<ng-template ...>
<button (click)="visible[idx]=false" cButtonClose white></button>
</ng-template>
...
</c-alert>
@xidedix I tried but it will not work. Is this the correct initialization of visible variable. visible = [true,true]
?
@32x0lf working example: https://stackblitz.com/edit/coreui-angular-alert-klshwt?file=src%2Fapp%2Fapp.component.ts
@xidedix Thanks it works.
Hi,
I am using alert to display notification based on array of data. I have an implementation to store these notifications in db once it is closed. I tried using this code but it will close all of the notifications even I just closed one of the notification. Did I miss something?
Thank you