angularjs - ng-repeat do not evaluate from $sce.trustAsHtml inside directive -


I have a tutorial in which there is a piece of custom HTML which I can pass as a custom option. I want to use ng-repeat inside of custom HTML, but it is not being displayed. Here's the code.

  var app = angular Module ('plunker', []); App.controller ('MainCtrl', function ($ scope) {$ scope.name = 'world'; $ scope.local = {option: {column: [{name: 'product_id', label: 'product id'}, {Name: 'product_name', label: 'name'}], getBody: function (col, i) {return col.name == 'product_id'? Col.label: '& lt; div class = "dropdown product-status "& Gt; button class =" btn btn-primary drop-down toggle "data-toggle =" dropdown "& gt; position & lt; span class =" carat "& gt; & lt; / span & gt; ; & Lt; / button & gt; & lt; span class = "drop-down arrow" & gt; & lt; / span & gt; & lt; ul class = "drop-down menu" & gt; & lt; Ng-repeat = "one_status dataset.status"> gt; & lt; a class = "position all" ng  
  • Lt; / div & gt; ';}}, dataset: {status: [{status_id: 1, status_name:' first format '}, {status_id: 2, status_name:' edit '}}}}}}; app Directive ('test', function ($ SCE) {var linkFunc = function (scope) {scope.getBody = function (col, index) {return $ sce.trustAsHtml (scope.options.getBody (col, index));} ;}; Return {link: linkFunc, area: {option: '=', dataset: '='}, templateUrl: 'test.html'};});

    You must ensure that $ sce in one

    .controller ('ngBindHtmlCtrl', ['$ scope', '$ SCE', function ngBindHtmlCtrl ($ scope, $ Sce) ... etc

    Also, check out this question:

  • Comments

    Popular posts from this blog

    ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

    Matlab transpose a table vector -

    c# - Textbox not clickable but editable -