Few html elements loaded from server side and angular click() event also part of it. but event is not firing after rendering the elements. I understand that i need to notify the DOM. I can not do this.
component.ts
mport { Component} from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: '../Views/Dashboard.html',
providers: []
})
export class DashboardComponent {
public deviceData="<div (click)="Go()">Click</div>"; //e.x: loaded from server
constructor(){
}
Go():void{
alert("Go");
}
}
html
<div [innerHTML]="deviceData"></div>