I have an external javascript file and I have a function that appends HTML to siteLayoutComponent.html DIV as below code:
function LoadNotificationData(data) {
$("#lstNotification").append(' <li id="' + data.id + '"><a (click)="logout()"><i class="fa fa-sign-out fa-fw" "></i>' + data.subject + '</a></li> <li id="dv' + data.id + '" class="divider"></li>')
}
logout function that in a siteLayoutComponent.ts
logout() {
this.router.navigate(['/login']);
}
after inspecting the generated code, we could realize that the event wasn't rendered in a correct way, I need to perform this binding dynamically in the appended HTML. any Ideas