Sha*_*hid 89 html rendering angular
在我的角度4应用程序中,我有一个字符串
comment: string;
comment = "<p><em><strong>abc</strong></em></p>";
Run Code Online (Sandbox Code Playgroud)
当我在我的HTML中提供这个文本时,就像
{{comment}}
Run Code Online (Sandbox Code Playgroud)
然后它显示:
<p><em><strong>abc</strong></em></p>
Run Code Online (Sandbox Code Playgroud)
但我需要以粗体和斜体形式显示文本"abc",如 abc
我怎样才能做到这一点?
Hai*_*ang 182
我在Angular 5.0项目中使用了以下内容:
<div [innerHTML]="comment"></div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
58774 次 |
| 最近记录: |