I'm trying to write a directive to load a partial html file, compile it against a scope & use it as the Bootstrap popover content.
However I'm stuck at a very basic step, write a hide() method on the popover scope so that I can easily close it using ng-click=hide().
This has been solved & the plunker is now covering other issues ;-).
UPDATE : plunker to the rescue : http://plnkr.co/edit/QH3NQh?p=preview
.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.name = "Hello"; // Using {{name}} is working scope.hide = function() { // Using ng-click="hide()" is not working :( 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 }); }); } } }]);