I have an Angular directive to handle Bootstrap popovers as shown in the code below. In my directive I\'m setting the popover content to a HTML string, which I think is ugly. W
To complete the answer from Khahn, if you load a dynamic template, the last part should look like that:
return {
restrict: "A",
scope: {
item: "=" // what needs to be passed to the template
},
link: function(scope, element, attrs) {
getTemplate("user").then(function(popOverContent) {
var options = {
content: $compile($(popOverContent))(scope),
placement: "bottom",
html: true,
trigger: "hover"
};
$(element).popover(options);
});
}
};