如何通过单击按钮编辑来使行可编辑。我尝试了contenteditable="{{stat}}"
并将此代码放在component.ts
中,但它无法正常工作
<tr *ngFor="let coll of colls">
<td><i title="Editer le Collaborateur" (click)="EditColl()" class="ion-edit ion-white"></i>
<i title="Supprimer le Collaborateur" (click)="DeleteColl(coll)" class="ion-trash-a"></i></td>
<td contenteditable="true">{{coll.cin}}</td>
<td>{{coll.lastname | uppercase}}</td>
<td>{{coll.firstname}}</td>
<td><a class="email" href="mailto:${{coll.email}}">{{coll.email | lowercase}}</a></td>
<td>{{coll.datenaissance}}</td>
<td>{{coll.dateembauche}}</td>
</tr>
component.ts
statut:string='false';
EditColl(){
if(this.statut==='true')
{
this.statut='false'
}
else
this.statut='true'
}