-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
I want to dynamically insert a <mat-checkbox> element into a component.
and I inserted two <mat-checkbox> elements. one inserted statically (i.e into the template file directly).
and the other one inserted dynamically, and contains a <mat-checkbox> and another normal checkbox <input type="checkbox" />
the first one (the statically inserted one) rendered without any problem.
also the normal input inserted dynamically without any problem.
but the <mat-checkbox> that dynamically inserted didn't render as expected.
component.html:
<mat-checkbox> checkbox (static) </mat-checkbox>
<div [innerHTML] = "test2">
component.ts:
this.test= `
<mat-checkbox>mat-checkbox</mat-checkbox><br />
<input type="checkbox" /> normal checkbox
`
this.test2 = this.sanitizer.bypassSecurityTrustHtml(this.test);
I created a Reproduction on stackblitz:
Metadata
Metadata
Assignees
Labels
No labels