Angular UI popover-html 抛出 $parse 错误
Angular UI popover-html is thowing a $parse error
我想在弹出窗口中显示我的自定义指令。我试过使用 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/$parse/syntax?p0=%3C&p1=not%20a%20primary%20expression&p2=1&p3=%3Ch1%3Ehi%3Ch2%3E&p4=%3Ch1%3Ehi%3Ch2%3E
处的示例代码
谢谢!
您似乎直接传递到工具提示,因此使用类似
的内容
<div tooltip-html="<h1>hello</h1>"
虽然这对大多数人来说都有意义,但这并不是图书馆希望您使用该指令的方式。 github 页面上有一个相关的 post 对此进行了详细讨论:https://github.com/angular-ui/bootstrap/issues/3790
这是一个显示如何使用 tooltip-html 指令的插件:http://plnkr.co/edit/v4NQXJjNDuyjl4agjtA0?p=preview
我想在弹出窗口中显示我的自定义指令。我试过使用 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/$parse/syntax?p0=%3C&p1=not%20a%20primary%20expression&p2=1&p3=%3Ch1%3Ehi%3Ch2%3E&p4=%3Ch1%3Ehi%3Ch2%3E
处的示例代码谢谢!
您似乎直接传递到工具提示,因此使用类似
的内容
<div tooltip-html="<h1>hello</h1>"
虽然这对大多数人来说都有意义,但这并不是图书馆希望您使用该指令的方式。 github 页面上有一个相关的 post 对此进行了详细讨论:https://github.com/angular-ui/bootstrap/issues/3790
这是一个显示如何使用 tooltip-html 指令的插件:http://plnkr.co/edit/v4NQXJjNDuyjl4agjtA0?p=preview