我想在每個行的ng表中爲點擊事件「onListFavorisAdded()」創建一個動態按鈕「Favoris」。該表在組件中創建並配置。所以我也在component.ts中創建了這個按鈕,之後我把它放在html中。該按鈕顯示在我的網頁,但是當我點擊它時不工作...組件中創建的角度爲2/4的事件點擊按鈕
HTML:
<ng-table [config]="config"
(tableChanged)="refreshTable(config)"
(expanderClicked)="expanderClicked($event)"
[rows]="rows" [columns]="columns"
[expandable]="true"
[expandedComponent]="rowComponent"
[rowInputs]="rowInputs">
</ng-table>
,可給我的組件行的功能:我爲做一個對於那些在創建表
for (let collab of collaborators) {
// Add a column name
collab.nomPrenom = this.getData(collab, "data.personne.nom", "").toUpperCase() + " " + this.getData(collab, "data.personne.prenom", "");
// Add a column preview
collab.preview = '<a class="btn-default" href="#/profile/' + this.getData(collab, "tgi") + '" aria-label="Profile"> <i class="fa fa-eye" aria-hidden="true"></i></a>';
// !!!!! Add a column Favoris !!!!!!!!
collab.favoris = '<button data-ng-click="onListFavorisAdded()"><i class="fa fa-star" aria-hidden="true"></i></button>';
感謝您的幫助每一行
你使用任何庫 – Aravind