Making an ajax call after a button click and updating the html inside the modal via angular js. Sometime html inside modal is not updating. Tried $scope.$apply(); function but still its not updating sometimes. Provided the angular js and bootstrap code below . editfilterrules function is called after clicking on a button,
$scope.editfilterrules=function(filterid,initid){
console.log('edit filter rules filterid:' + filterid + ' initid:' + initiativeid );
$http({
method : "GET",
url : 'testoptions.php?filterid=' + filterid + '&initid=' + iniid
}).then(function mySucces(response) {
// console.log(response.data);
$scope.filterrulesDivCon=$sce.trustAsHtml(response.data);
// $('#filterrulesDiv').html(response.data);
// $scope.$apply();
$('#editfilterrulesModal').modal();
}, function myError(response) {
});
}
<div class="modal fade" id="editfilterrulesModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Edit Filter Rules</h4>
</div>
<div class="modal-body">
<div id="filterrulesDiv" ng-bind-html="filterrulesDivCon" ng-cloak> </div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->