We have dynamic templates. Inside ng-repeat
I am using ng-bind-html
which calls a method that returns HTML, but the expressions in that HTML were not rendering. Any idea why?
<div ng-bind-html="vm.getSimpleLayoutHtml(item)" class="ng-binding ng-scope">
<div class="col-xs-4" ng-if="item.Account.Name">{{ item.Account.Name }}</div>
</div>
Here is the controller:
function TestController($scope, resource,$sce)
{
var vm= this;
vm.getSimpleLayoutHtml = function (item) {
var result = resource.getLayout(item.attributes.type, "Simple");
return $sce.trustAsHtml(result.Html);
};
};