twitter-bootstrap popover 元素的 popover-append-to-body 属性在 angular-ui 中似乎不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20347097/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 19:22:54  来源:igfitidea点击:

popover-append-to-body attribute for a popover element doesn't seem to work in angular-ui

angularjstwitter-bootstrappopoverangular-ui

提问by Benjamin Crouzier

I am using angular UI. (docs, github)

我正在使用角度 UI。(文档github

I would like to make a popover that is appended on body.

我想制作一个附加在身体上的弹出框。

But I tried this attribute, and my popover is not appended on body. (Note that other attributes, such as placement='right'do work.)

但是我尝试了这个属性,我的弹出框没有附加到正文中。(请注意其他属性,例如placement='right'do 工作。)

Html for the popover:

弹出窗口的 Html:

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

Note: In the source, I don't find anything related to popover-append-to-body

注意:在源代码中,我没有找到任何与popover-append-to-body

回答by Benjamin Crouzier

It looks like it works with the latest version of angular ui.

看起来它适用于最新版本的 angular ui。

In this plunkerit does work. (click run, then click dynamicPopoverText, then inspect popover and see that it's indeed just below body).

这个plunker中它确实有效。(单击运行,然后单击dynamicPopoverText,然后检查弹出窗口并查看它确实就在 下方body)。

Edit: the problem was that in my project, I was using angular-ui 0.1.0 instead of angular-ui 0.4.0

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