$tooltipProvider - how do I actually use setTriggers() ?
The documentation states that I am able to set new triggers using the $tooltipProvider and setTriggers() method, however I have so far been unable to achieve this.
I have included this in my module config:
$tooltipProvider.setTriggers({ 'inputInvalid' : 'inputValid' });
However it does not find the method. I dived into the source and see the method there, but it's tossed inside a $get method which then returns the dependencies. Perhaps I am doing something wrong here and I simply do not understand how to get the $tooltipProvider to work?
@franciscopreller Sends us a plunker (http://plnkr.co/) with what you've tried so far. Also, since this is a question, it should be asked on the mailing list ([email protected]).
Thanks, will move it to google groups then, was unsure where else to get help.
@franciscopreller Did you ever figure out how to properly use setTriggers()? I looked for your post on Google Groups but wasn't able to find it.
@baconmania Hey, yes I did. Was something simple like updating from an old version. Became apparent when I set it up on plunker exactly the same and it worked as it should have.
Francis, could you please provide your plunker? I believe I need the same functionality.
I spent some time today researching how to set up ui-bootstrap triggers to respond to custom events for my project, so I threw what I found into a plunker: http://plnkr.co/edit/0wEqzz?p=preview . In my case, I needed to be able to trigger a popup on element A when hovering the mouse over element B.
@courtneyfaulkner, that was super helpful to me, thanks very much!
@courtneyfaulkner, you are a wizard! thank you so much for putting your effort into that plunker, it is extremely helpful) thanks a bunch!
Happy to help. :)
@courtneyfaulkner perfect demo :)
@courtneyfaulkner Is it actually necessary to name also the default triggers? I think the given object is extending the default one. So this should work:
$tooltipProvider.setTriggers({'customEvent': 'customEvent'});
@Elijen No, it's not necessary. The default trigger map
{
'mouseenter': 'mouseleave',
'click': 'click',
'focus': 'blur'
}
will be extended with the attributes in .setTriggers().
@courtneyfaulkner Thank you so much for the Plunkr demo, very helpful to us Angular n00bs
@courtneyfaulkner thanks alot! great plnkr. In my case i had to trigger the popover to close when selecting an item inside the popover.
Thx, @courtneyfaulkner. :smile:
I'm happy I could help. :)
The plunler is broken with the 0.13.4 release of the 3 september 2015.
Use popover-is-open instead
http://plnkr.co/edit/dm408dUoFKRVQKE9SOTb?p=preview
Ah, interesting. I was reading your issue #4364, @cyrilgandon, and spent some time with uib 0.14.1 in plunkr. I was able to get a custom event to fire the uib-tooltip once by using $('#tooltipTarget')[0].dispatchEvent(new Event('customEvent'));, which is not intuitive, and also fails to work on subsequent mouseovers. Per #4364, it seems they're still trying to fix their handling of custom events. 0.14.1 seems to be handling tooltip-is-open functionality pretty well, but in 0.13.4, I'm seeing bad tooltip positioning problems. I updated my http://plnkr.co/edit/0wEqzz?p=preview plunkr to be similar to yours, to avoid confusion for people coming across this thread. If/when they fix custom events, I may update my plunkr again.
@courtneyfaulkner toolip-is-open approach isn't stable with tooltip-popup-delay. I can't find a way to clear a delay timeout without custom triggers. So the tooltip showing after a delay no matter if you set open to false.