I understood a lot, but the solution for me does not work. I am trying to call a method in my code, but it does not work. An error has occurred, but the click event does not work either. In my code, I add a button dynamically and it is added to my code. But when I click on Approvedor UnApproved, nothing happens. I use buttons <ng-table>, Approvedand UnApprovedin the directive <ng-table>. Please suggest me where I am doing wrong?
My code is:
editData() {
this.data.forEach(function (row) {
if (row.isApproved) {
row.editButton = "<button (click)='approveUnApproveLeave()'>UnApproved</button>";
} else {
row.editButton = "<button (click)='approveUnApproveLeave()'>Approved</button>";
row.isApproved = row.isApproved.toString();
}
})
}
approveUnApproveLeave() {
console.log("approveUnApproveLeave called");
}
}
See the picture for a better understanding.

source
share