所以我在表单中有一个<textarea>
:
<form novalidate [formGroup]="formGroup" (ngSubmit)="onSubmit()">
<textarea formControlName="content" [rows]="5"><textarea>
我正在设置表单内的内容值。
this.formGroup.setValue(
{
'submitterTolist': this.result.submitterlist,
'reviewerTolist': this.result.reviewerlist,
'attesterTolist': this.result.attesterlist,
'mailCclist': this.result.email_cc,
'strsubject': this.result.subject,
'content': this.result.content
}
我面临的问题是内容值为html
我需要在<textarea>
元素中呈现,而不是仅将文本显示为html
。
以下是内容示例:
<p>Kindly be informed that the resubmission of Monthly Actuals data for Mexico Internal Fraud Others for Nov 2017 has been approved by the Regional Oversight Manager in the Enterprise Risk - Fraud Capture Application.</p> <p>The following comments have been provided:</p> Approved. Citirisk Team provided the data to be uploaded. <p>Thank You</p>
答案 0 :(得分:0)
您无法在文本区域中呈现html。您可以添加div元素并使用属性biding来设置innerHTML属性。
<div [innerHTML]="theStringWithHtmlTags"></div>