Angular2 - catch/subscribe to (click) event in dynamically added HTML
问题 I'm attempting to inject a string that contains a (click) event into the Angular2 template. The string is dynamically retrieved from the back-end much after the DOM is loaded. No surprise here that Angular won't recognize the injected (click) event. Example template: <div [innerHTML]="test"></div> Example string given from back-end: var test = "When ready, <span (click)=\"itemClick($event)\">click me</span>." Example function call in the Angular component: itemClick(event) { debugger; } My