Popover: data - trigger: How to "NOT" trigger a popover.
I have a HTML code like this on the button: data-trigger="{{{true: 'hover', false:'never'}[form.$invalid]}}"
The popover triggers when form is invalid(which will fire 'hover'). And I want the popover NOT to trigger when form is valid i.e "false: never" . And this "false:never" isn't working. Is there any work around for this...?
Try using false: 'manual', that should do what you want.
Tried with 'manual' but still the same issue.
Can you give us a plunker sample? I tried the docs example with data-trigger="manual" and the popover didn't show on hover or click, so maybe I didn't understand what you needed?
I tried with data-trigger='manual', it's working fine, the the popover didn't show on hover or click. But when I use in this way: data-trigger="{{{true: 'hover', false:'manual'}[form.$invalid]}}", the popovers are still showing even when form is valid. Sure will provide a plunker sample..in next post.
here's the plunker sample: http://plnkr.co/edit/eMsWxXmFX6hVQbzryQ3L?p=preview
I see your problem now. I didn't remember you would need to change the trigger value dynamically, and the popover is not watching the trigger attribute for changes, so it won't work as is.
Maybe you can create a custom directive which uses the $popover service and add the tracking/checking of the form status there.
I'm also submitting a PR for a new bsEnabled attribute that would allow for enabling/disabling the directive that might solve this issue in the future.
bsEnabled has been added in 957fd18.
@vmlf01 : So can I write like this.?
data-trigger = "hover" bs-enabled = "form.$invalid"
Yep, that's the idea, but I see now that the PR only does it for tooltip. Now it needs to be added to the other directives that use tooltip. Check this updated plunker with the tooltip: http://plnkr.co/edit/P4XCPm9K9rc6zZLXWbxs?p=preview
Yep..! thanks for the plunker!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.