export class SetUpAppPopupComponent {
constructor(public sanitizer: DomSanitizer) { }
ngOnInit() {
this.IFrameUrl = this.sanitizer.bypassSecurityTrustResourceUrl("https://angular.io/");
}
getAppHtml() {
var MinifiedHtml = "<div> <iframe class=\"col-md-12\" style=\"display:block;height:100%\" [src]=\"IFrameUrl\" frameborder=\"0\" allowFullScreen=\"true\"></iframe> </div>"
return this.sanitizer.bypassSecurityTrustHtml(MinifiedHtml);
}
}
.html
<div [innerHtml]="getAppHtml()"></div>
If you look at the above example HTML is getting rendered but the JSON model object "IFrameUrl" is not getting binded to IFrame tag. Is there a way to achieve it?