So I am creating a simple fill in the blanks app and I have identifiers in the string that I want to replace with the select box.
Typescript
const string = `##blank.0## is the capital city of China. It's most famous attraction is## blank .1##.`;
ngOnInit() {
this.answers.forEach(a => {
this.string = this.sanitizer.bypassSecurityTrustHtml(this.string.replace(`##blank.${a.index}##`,
`<select class="select-boxes">
<option *ngFor="let answer of ${a.answers}" [value]="answer.id">
{{ answer.content }}
</option>
</select> `));
});
}
HTML
<p [innerHTML]="string"></p>
Problem
It renders the select box but neither the styles nor the *ngFor list.
Any help would be greatly appreciated.