AngularJS ng-click roto dentro de un popover

Estoy intentando escribir una directiva para cargar un archivo html parcial, compilarlo en un ámbito y usarlo como el contenido emergente de Bootstrap.

Sin embargo, estoy atascado en un paso muy básico, escriba un método hide () en el alcance del popover para poder cerrarlo fácilmente usandong-click=hide().

Esto se ha resuelto y el desplumador ahora está cubriendo otros problemas ;-).

ACTUALIZACIÓN: desplumador al rescate: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
            });
        });


    }
}
}]);

Respuestas a la pregunta(4)

Su respuesta a la pregunta