Angular 从DB中获取部分可编辑的HTML内容,并绑定到div标记6

Angular 从DB中获取部分可编辑的HTML内容,并绑定到div标记6,angular,contenteditable,Angular,Contenteditable,我正在从后端获取部分可编辑的内容。e、 g <p>Dear <b>empname</b>,<br /><br />This refers to the Notice issued to you on date regarding your alleged <i contentEditable="true">____________</i> and violation of the Employee Code

我正在从后端获取部分可编辑的内容。e、 g

<p>Dear <b>empname</b>,<br /><br />This refers to the Notice issued 
 to you on date regarding your alleged <i contentEditable="true">____________</i>
and violation of the Employee Code of Conduct,
particularly the <i contentEditable="true">____________</i>.<br /><br /></p>
亲爱的empname,

这是指发出的通知 关于你所声称的____________ 违反员工行为准则, 尤其是

我正在将此内容绑定到div标签

<div [innerHTML]="text"></div>


在此之后,内容不可编辑。我不希望完整的内容是可编辑的,只有div中的I标记。

显然,我会清除数据中的任何恶意内容,因此它是从我从API获取的HTML数据中删除的。我使用下面的代码使它工作

this.sanitizer.bypassSecurityTrustHtml(data);