Updated Answer
Anything having to do with DOM should go into a directive and not a controller. In fact, by transitioning to a directive, your problem can be easily solved.
Placing your popover HTML into a template that is included in a directive will cause its content will be compiled by Angular automatically. In this case, a manual $compile
using content extracted from the DOM by jQuery -- which seems to be at the root of the problem -- is unnecessary.
Such a directive might look like this:
.directive('myPopover', function($compile){
return {
restrict: 'EA',
controller: function($scope){
$scope.clearFilter = function(){
$scope.filterOption = "";
};
$scope.setFilterOption = function(){
console.log("filter option :",$scope.filterOption);
if($scope.filterOption == 'hdnodes'){ }
else if($scope.filterOption == 'gnodes'){ }
else if($scope.filterOption == 'clusters'){ }
else if($scope.filterOption == 'standalones'){ }
};
},
link: function(scope, elem, attrs) {
elem.popover({
trigger:'click',
html : true,
placement: 'bottom',
content: function() {
return elem.find('div');
}
});
},
templateUrl: 'fn-dialog.html'
}
})
... where fn-dialog.html
looks like this:
<!-- Button which opens popover when clicked -->
<button title="Filter" type="button" name="filter-node-btn" class="filter-node-btn">open</button>
<!-- Popover content -->
<div class="filterNodeDialog">
<div class="filterCriteriaContent">
<form name="filterCriteriaForm">
<input type="radio" name="filterOption" value="hdnodes" ng-model="filterOption" ng-change="setFilterOption();">
<span>All HD nodes</span>
[ the rest of the content for the popover ... ]