我有一些文本,在Angular 5组件中如下。
区域故障M&Sup2;
不幸的是,Angular打破了我整洁的小平方角色并显示以下内容:
区域故障M& sup2;
component.ts
@Component({
templateUrl: `component.html`
})
export class SourceDocumentWorkItemsComponent implements OnInit {
// (all very standard)
}
component.html
<div class="input-group">
<label class="bold">Area Breakdown m²</label>
</div>
我如何阻止角度粘合我的html ...我很确定在这里是culprit。
根据您的要求,请尝试使用[innerHTML]
,而是在下面提供输出:
areaBreakdownText:string='Area Breakdown m²';
<label class="bold" [innerHTML]="areaBreakdownText"></label>