I've found example of calling function in innerHtml https://stackblitz.com/edit/angular-innerhtml-examples , but I don't know what to do, if function needs variable, which acceptable only from controller:
constructor(private elementRef: ElementRef, private sanitizer: DomSanitizer) {
const currentString = "green";
this.content = this.sanitizer.bypassSecurityTrustHtml(
'<button type="button" id="submitButton" (click)="openWindow()">Submit</buttn>'
);
}
openWindow(string) {
alert(string);
}