Created
August 30, 2012 17:05
-
-
Save mgcrea/3533482 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('uiPopover', ['$compile', '$http', function($compile, $http) { | |
return { | |
restrict: 'A', | |
scope: { | |
hide: '&hide' // did not understand what is this | |
}, | |
link: function postLink(scope, element, attr, ctrl) { | |
console.warn('postLink', arguments, this); | |
// scope is the anchor scope | |
scope.hide = function() { | |
console.log('in'); | |
element.popover('hide'); | |
} | |
$http.get(attr.uiPopover).success(function(data) { | |
element.popover({ | |
content: $compile(data)(scope), // popover content will get a new scope that I need to put hide() on. | |
html: true | |
}); | |
}); | |
} | |
} | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment