I am trying to pass a parameter to a function for a given ID. Here is the code of the content of my HTML.
<header class="card-header">
<p class="card-header-title">
{{taskName}}
</p>
<p class="card-header-icon">
<span [ngClass]="colorClass">
<i class="fas fa-circle"></i>
</span>
<button class="card-footer-item button is-primary" (click)='deleteTaskById('{{id}}')'>X</button>
</p>
</header>
I am a beginner in Angular and I am wondering how can I pass the content of {{id}} in my function in the easiest way.
I have the following error message on my console :
compiler.js:215 Uncaught Error: Template parse errors:
Unexpected closing tag "button". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (" </span>
<button class="card-footer-item button is-primary" (click)='deleteTaskById('{{id}}')'>X[ERROR ->]</button>
</p>
</header>
Here is my function implementation :
deleteTaskById(idCard){
let card = {
id: idCard,
deadline: "",
description: "",
responsible: {},
state: "",
endDate: "",
priority: ""
};
this.taskService.delete(idCard).subscribe(res => {
});
console.log("delete task : " + card.id);
}
Thanks for you help.