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

时间:2022-01-24 10:41:49

I am using angular UI. (docs, github)

我正在使用角度UI。 (docs,github)

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

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

  • In pure bootstrap, you have to use container: 'body' so that your popover is appended on the body element instead of the parent element of your popover. (see http://getbootstrap.com/2.3.2/javascript.html#popovers)

    在纯引导程序中,您必须使用容器:'body',以便将popover附加到body元素而不是popover的父元素。 (见http://getbootstrap.com/2.3.2/javascript.html#popovers)

  • In Angular UI, you are supposed to use popover-append-to-body (see http://angular-ui.github.io/bootstrap/#/popover).

    在Angular UI中,您应该使用popover-append-to-body(请参阅http://angular-ui.github.io/bootstrap/#/popover)。

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

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

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相关的内容

1 个解决方案

#1


5  

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

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

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

在这个plunker它确实有效。 (单击运行,然后单击dynamicPopoverText,然后检查popover并查看它确实位于正文下方)。

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

#1


5  

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

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

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

在这个plunker它确实有效。 (单击运行,然后单击dynamicPopoverText,然后检查popover并查看它确实位于正文下方)。

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