angularjs – popover元素的popover-append-to-body属性似乎不适用于angular-ui

前端之家收集整理的这篇文章主要介绍了angularjs – popover元素的popover-append-to-body属性似乎不适用于angular-ui前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用角度UI. ( docs,github)

我想制作一个贴在身上的弹出窗口.

>在纯引导程序中,您必须使用容器:’body’,以便将popover附加到body元素而不是popover的父元素上. (见http://getbootstrap.com/2.3.2/javascript.html#popovers)
>在Angular UI中,您应该使用popover-append-to-body(参见http://angular-ui.github.io/bootstrap/#/popover).

但我尝试了这个属性,并且我的popover没有附加在身体上. (请注意,其他属性,例如placement =’right’可以正常工作.)

弹出窗口的Html:

<a popover="click me" popover-placement='bottom' popover-append-to-body='true'>
  popover text
</a>

注意:在source中,我找不到与popover-append-to-body相关的任何内容

解决方法

看起来它适用于最新版本的角度ui.

this plunker它确实有效. (单击“运行”,然后单击“dynamicPopoverText”,然后检查popover并查看它确实位于正文下方).

编辑:问题是在我的项目中,我使用的是angular-ui 0.1.0而不是angular-ui 0.4.0

猜你在找的Angularjs相关文章