I am trying to set up a system which loads the html page from a stored html file and renders it with angular. How to bind property and event in this file, I'm trying to inject it with innerHTML.
ParentComponent.ts
genericAttribut ="Hello"
getHtmlContent(){
id =1;
this.service.getHtmlContent(id).subscribe((data)=>
myTemplate =data;
});
}
genericFunction(){
console.log("fire");
}
ParentComponent.html
<div [innerHTML]="myTemplate | safeHtml"></div>
Template-1.html
<button (click)="genericFunction()">{{genericAttribut}}</button>
When i try this, angular don't do the binding.