I've modified the popover directive to include files and $compile them. With this I've gotten ng-repeats to work but trying to add a typeahead will not work.
angular.module("app").directive("boundPopover", ['$compile', '$http', function($compile, $http) {
return {
restrict: 'A',
link: function(scope, element, attr, ctrl) {
var content = attr["popoverContent"];
var title = attr["popoverTitle"];
function initPopup() {
element.popover({
html: true,
content: $compile(content)(scope),
title: $compile(title)(scope),
placement: attr["popoverPlacement"]
});
};
if(attr["popoverContentInclude"] || attr["popoverTitleInclude"]) {
var contentLoaded = false;
var titleLoaded = false;
if(!attr["popoverContentInclude"]) {
contentLoaded = true;
}
if(!attr["popoverTitleInclude"]) {
titleLoaded = true;
}
if(!contentLoaded) {
$http.get(attr["popoverContentInclude"]).success(function(d) {
content = d;
contentLoaded = true;
if(titleLoaded) {
initPopup();
}
});
}
if(!titleLoaded) {
$http.get(attr["popoverTitleInclude"]).success(function(d) {
title = d;
titleLoaded = true;
if(contentLoaded) {
initPopup();
}
});
}
}
else
{
initPopup();
}
}
}
}]);
Where the included title file is-
<span class="glyphicon glyphicon-search"></span><input class='devices-search' ng-controller="DeviceCtrl" typeahead="state for state in states | filter:$viewValue | limitTo:10" ng-model="state"/>
It works when put straight on the page or in ng-include but not in this situation. Any idea what I can do?