Skip to content Skip to sidebar Skip to footer

Angular 4 Passing A Value From Html Template To A Method In A Component

So I am having this issue on Angular 4. I have this button in my html template markup: <

Solution 1:

just pass data.id to delete function

  <td><a class="btn btn-danger" (click)="delete(data.id)"><i class="fa fa-trash"></i></a></td>

and then in your delete function

    delete(id : any){
console.log(id);
// perform your action
}

Post a Comment for "Angular 4 Passing A Value From Html Template To A Method In A Component"