This is what I tried, and of course it makes visible all the items:
<ng-template let-file let-i="index" pTemplate="file">
<div class="ui-fileupload-row">
<div><img [src]="file.objectURL" width="50"/></div>
<div>{{file.name}}</div>
<div>{{formatSize(file.size)}}</div>
<div><button (click)="toggleIsFormVisible()">Add metadata <i class="fa fa-plus"></i></button></div>
</div>
<div *ngIf="isFormVisible"></div>
</ng-template>
toggleIsFormVisible()
{
this.isFormVisible = !this.isFormVisible;
}
How do you do this knowing only the index, and without duplicating the items?
this.isFormVisible
ngIf="IsFormVisible"
The issue is with capitalized i
letter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With