Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am using angular 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)

  • In Angular UI, you are supposed to use popover-append-to-body (see 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.)

Html for the popover:

<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

like image 445
Benjamin Crouzier Avatar asked Dec 03 '13 09:12

Benjamin Crouzier


1 Answers

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

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

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

like image 125
Benjamin Crouzier Avatar answered Oct 04 '22 01:10

Benjamin Crouzier