diff options
| author | Teddy Wing | 2014-06-25 20:53:40 -0400 |
|---|---|---|
| committer | Teddy Wing | 2014-06-25 20:53:40 -0400 |
| commit | 0f134b2c8e02bbd8690516f42680e8be715af481 (patch) | |
| tree | 3b275f3fc621f98037cb2f74c830ef9dbeb000b7 | |
| parent | b5af5fc5248ba2f2b10131ff3402febc695e6795 (diff) | |
| download | nsPopover-0f134b2c8e02bbd8690516f42680e8be715af481.tar.bz2 | |
Isolate popover directive scopeisolate-popover-scope
Previously, if multiple popovers were added, they would all share the
same scope.
I encountered an issue when trying to add several popovers, each with a
"close" link that specifying `ng-click="hidePopover()"`. Since all
popovers share scope, the `hidePopover()` function only knows about the
last popover it saw. This means that only that last popover can be
hidden using `hidePopover()`.
This change ensures that all popovers have their own scope, so
`hidePopover()` will now operate on the correct instance.
Fixes #11.
| -rw-r--r-- | src/nsPopover.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nsPopover.js b/src/nsPopover.js index d43dc4a..c4626dc 100644 --- a/src/nsPopover.js +++ b/src/nsPopover.js @@ -11,6 +11,7 @@ module.directive('nsPopover', function($timeout, $templateCache, $q, $http, $compile, $document) {
return {
restrict: 'A',
+ scope: true,
link: function(scope, elm, attrs) {
var options = {
template: attrs.nsPopoverTemplate,
|
