0

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); 
    }; 
};
4

1 に答える 1

0

ng-HtmlCompiler @ https://github.com/rroxysam/ng-htmlCompilerを試してみてください

于 2016-03-02T10:48:00.613 に答える