I have a array of items and each item will display a link. If any button is clicked, I would like to replace it with an input text box.
*** Template ***
<ng-container *ngFor="let item of items">
<p>
<button id="item-{{ item.id }} " (click)="showInput($event, item.id)"></button>
</p>
</ng-container>
*** Component ***
showInput(ev: MouseEvent, id:number){
ev.stopPropagation();
let inputHtml = `<input type=\'text\' id=\'${id}\'/>`;
console.log(ev.srcElement);
// Replace element with input
console.log(id);
}