Hi I have form questions that require the user to replace text in a sentence. For example... 'Today is ' where the user will fill in the current day but I am not able to inject inputs through 'innerHtml' alone. I have placed my current code below:
private _replacementInput: string = '<input type="text" class="replacement-input">';
public get replacementInput() : SafeHtml {
return this._sanitizer.bypassSecurityTrustHtml(this._replacementInput);
}
constructor(private _sanitizer: DomSanitizer) {
}
and then in my view I have:
Today is <span [innerHtml]='replacementInput'></span>
As far as I can tell my code is correct but I still get an empty span tag rather than one with an input inside.