I'm currently working on creating an element through code that looks like this:
let template=``;
for(let i=0;i<wht.length;i++){
template +=`<li title="${wht[i]}" style="color:#000">
<span (click)="slctRmv($event)">×</span>${wht[i]}
</li>`;
}
jQuery("#myId").prepend(template);
The content is getting appended to myId successfully, however, the click event is not triggering as expected in the template.
Is there a solution available for this issue in Angular 2?