我希望通过块{{}}
在html中获取空格I tried {{myVariable}}, then I got html with " "
may I know how can I get a html " " in block {{myVariable}}?
Thanks very much.
示例:<div class="o-grid__cell o-grid__cell--width-75">{{task.word.phrase}}</div>
转移到<div class="o-grid__cell o-grid__cell--width-75">someone who tells the actors in a film or play what to do</div>
但我认为必须<div class="o-grid__cell o-grid__cell--width-75">someone who tells the actors in a film or play what to do</div>
在angular1中我搜索https://github.com/angular/angular.js/issues/1505,但不明白如何在Angular2中使用。
答案 0 :(得分:1)
我认为您希望将my html {{" "}}
显示为my html " "
。您可以通过" "
"
来获取内嵌\\
的html
I tried {{"\\" \\""}}, then I got html " "
更好的方法是在"
(单个qoute)内'
(双qoute)。无需逃避。
<summary>I tried {{'" "'}}, then I got html " "</summary>
答案 1 :(得分:0)
您可以使用ngNonBindable,虽然它目前是undocumented。
<div ngNonBindable>
{{ }}
</div>