I have some buttons that I store in DB.
But I don't know how to work with (click)
For example, I have a button "Close" that on click sets a boolean to false isVisible = false
Model:
export interface Button {
label: string;
class: string;
iconClass: string;
doJob: any;
}
Template:
<p-footer *ngIf="hasPopupButtons()">
<a (click)="doStuff(button.doJob)" *ngFor="let button of Buttons" [ngClass]="button.class"><i
[ngClass]="button.iconClass"></i>{{button.label}}</a>
</p-footer>
Click function:
doStuff(dostuff: any) {
//??
}
How can I do this in a elegant way?