我想在弹出窗口中显示我的自定义指令。我尝试过使用 https://angular-ui.github.io/bootstrap/#/popover 中的 popover-html
但我收到此错误。
Uncaught Error: [$parse:syntax] Syntax Error: Token '<' not a primary expression at column 1 of the expression [<h1>hi<h2>] starting at [<h1>hi<h2>].
http://errors.angularjs.org/1.4.5/ $解析/语法?p0=%3C&p1=not%20a%20primary%20表达式&p2=1&p3=%3Ch1%3Ehi%3Ch2%3E&p4=%3Ch1%3Ehi%3Ch2%3E
谢谢!
最佳答案
似乎您直接传递到工具提示,因此使用类似的内容
<div tooltip-html="<h1>hello</h1>"
虽然这对大多数人来说都是有意义的,但这并不是图书馆期望您使用该指令的方式。 github 页面上有一篇相关的文章详细讨论了这个问题:https://github.com/angular-ui/bootstrap/issues/3790
这是一个展示如何使用 tooltip-html 指令的 plunker:http://plnkr.co/edit/v4NQXJjNDuyjl4agjtA0?p=preview
关于javascript - Angular UI popover-html 抛出 $parse 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32925899/