The problem is that the new HTML is not being compiled by Angular. The simplest solution may be to manually compile the dynamic content using the $compile
service. Do this in a custom directive and replace ng-bind-html-unsafe="r.alink"
with something like htmlinsert="r.alink"
. Here is how that directive could be coded:
angular.module('appp', [])
.directive('htmlinsert',function($compile){
return {
scope: {
htmlinsert: '='
},
link: function(scope,element,attrs){
var compiledElement = $compile(scope.htmlinsert)(scope);
element.append(compiledElement);
}
}
});
The reference to the html string is passed using isolate scope binding, and is then compiled before being appended to the current iteration of the repeated DOM element.