I try to use [innerHTML] inside <mat-option> of <mat-select> which works fine for the drop-down list, but not for the selected value.
Versions:
- Browser Google Chrome 68.0.3440.106 (Official Build) (64-bit)
- Angular 6.1.6
- Angular material 6.4.6
- bootstrap 4.1.3
- @ng-bootstrap/ng-bootstrap 3.2.0
In my example the used code is
<mat-form-field class="col-11">
<mat-select
[(ngModel)]="node.nodeType"
(change)="nodeTypeChanged()"
placeholder="{{'node.node_type' | translate}}"
[compareWith]="compareObjects">
<mat-option
*ngFor="let item of nodeTypes"
[value]="item">
<span [innerHTML]="item.iconVisual.iconCodeHtml"></span>
<span> {{item.label}}</span>
</mat-option>
</mat-select>
</mat-form-field>
The attached screen captures with combo box unselected where the task icon is not rendered and the selected combo box where the icons are correctly rendered, shows the problem.
Selected combo box: icon not rendered
Unselected combo box: all icons rendered
Simplified stackblitz here.
Is this a bug or am I missing something?

