Open viruletdew opened 9 years ago
I think you can solve it by using event broadcast.
Thanks. I tried adding the following to my directive. It doesn't seem to work though. Popovers still open without closing the others.
$scope.myf = function(index) { $scope.$broadcast('answered'+index); }
My buttons html: ng-click="myf($index)" ns-popover ns-popover-template="popover.html" ns-popover-placement="top|center" ns-popover-theme="ns-popover-mytheme" ns-popover-hide-on-click="false" ns-popover-modal="true" ns-popover-hide-on-outside-click="false" ns-popover-scope-event="answered{{$index}}" ns-popover-timeout="1000"
Is my (above) code the proper way of implementing the broadcast event for the popover?
Hi,
I have 3 buttons on a page. When the user clicks a button, I want to show the popover associated with that button. I also need to keep the popover open even if the user clicks outside of it - unless clicking on another button that triggers a popover.
I think I am supposed to use both ns-popover-hide-on-outside-click='false' along with ns-popover-modal="true". Unfortunately, what occurs is multiple popovers rendering on the screen, with each button click.
Is this a conflict?
Is there a way to trigger all popovers to close before showing the chosen one, when clicking a triggering button? hidePopover is only usable within the popover template.
Thanks for any help!