【发布时间】:2020-07-29 22:40:23
【问题描述】:
我想在 Angular 应用中写一些关于 html 标签的信息。我无法弄清楚如何在不呈现 html 的情况下在 Angular 模板中显示 html 标签。
例如
component.html
<p> you can use <code> </p> </code> tag for paragraph </p>
预期:
you can use </p> tag for paragraph
一种方法是在组件中创建变量并将其插入到视图中。但我不认为只为单个标签文本创建这么多变量。
例如
component.html
<p> you can use <code> {{myPTag}} </code> tag for paragraph </p>
component.ts
...
myPTag = "</p>"
...
【问题讨论】:
标签: javascript html angular