I have the following component
@Component({
selector: 'app-models-sd-htmlview',
styleUrls: ['./sd.component.scss'],
template: `
<iframe id="htmlview" style="width:100%; height:200%;" [src]="iframe"></iframe>
`
})
export class HtmlViewComponent implements OnInit {
@Input() urlhash;
@Input() predictiontag;
public iframe;
constructor(public sanitizer: DomSanitizer)
{
this.sanitizer = sanitizer;
};
ngOnInit()
{
var url = "http://localhost:8080/htmlview/" + this.urlhash + "/" + this.predictiontag + ".html";
this.iframe = this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
}
<app-models-sd-htmlview [urlhash]="urlhash" [predictiontag]="predictiontag"></app-models-sd-htmlview>
But when I render everything, this is what I see. The values for this.urlhash and this.predictiontag are undefined.

For some reason, it takes time to get the values for 'urlhash' and/or 'predictiontag' in the parent, so them are not "binded" yet to the 'HtmlViewComponent' component when it execute ngOnInit() method.
Try this little change, to achive that 'iframe' property only try to gets its value when 'urlhash' and 'predictiontag' get their value:
And in your parent HTML:
NOTE: If it works fine, probably this shortened form will work as well: