Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

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.

share|improve this question
    
Documentation: 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: 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 Answer 1

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

share|improve this answer
    
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 7:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.