0

How can I use popover via javascript in angularjs module with ui.bootstrap?

I am looking a solution like $modal service.

Thanks for your help.

  • Documentation: http://angular-ui.github.io/bootstrap/#/popover – Alessandro Pezzato Jan 22 '14 at 10:40
  • Alessandro, please could you specify ? I expected a service look-like $popover... but I didn't find it. Re-edit: more information on: https://github.com/angular-ui/bootstrap/issues/590 – user3223056 Jan 22 '14 at 12:51
  • Sorry, but I don't understand how you want to use popover like a service. $modal service is a shortcut to open a modal (only one instance in your app). Popover let you specify a popover as many elements as you want. – Alessandro Pezzato Jan 22 '14 at 14:23
  • Do you want to trigger the popover without click/mouseenter? – Alessandro Pezzato Jan 22 '14 at 14:26
  • I would like $watch the mouseenter event on a picture. When this event is fired, I would like to do some code like this: $popover({options}). With options could be some thing like this: {content: pictureTag, html:true } – user3223056 Jan 22 '14 at 15:11

1 Answers1

0

AngularJS is a declarative framework. It's a bad style to use imperative behavior like calling a function when a event happen.

You can get what you want with a new directive, for your special case "image that popover a text when mouseenter". Refer to this Create Hoverable popover using angular-ui-bootstrap

Community
  • 1
  • 1
Alessandro Pezzato
  • 8,603
  • 5
  • 45
  • 63
  • Dear Alessandro, thks so much for your helping. In fact at this time, ui.bootstrap doesn't implement the popover service as angular-strap did it. I suppose that the AngularUI team should implement it asap according this issue: github.com/angular-ui/bootstrap/issues/590. Your solution is around angular-strap & I wanted before use a solution with ui.bootstrap. – user3223056 Jan 23 '14 at 07:05