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.

5
  • Documentation: angular-ui.github.io/bootstrap/#/popover Commented Jan 22, 2014 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: github.com/angular-ui/bootstrap/issues/590 Commented Jan 22, 2014 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. Commented Jan 22, 2014 at 14:23
  • Do you want to trigger the popover without click/mouseenter? Commented Jan 22, 2014 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 } Commented Jan 22, 2014 at 15:11

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.