ng-bind-html =“trustAsHtml(procedure.description [0] .answer)| limitTo:100”limitto无法使用ng-html-bind

时间:2015-09-23 13:39:22

标签: angularjs javascript-objects

 ng-bind-html="trustAsHtml(procedure.description[0].answer)
|limitTo:100"

$scope.trustAsHtml = $sce.trustAsHtml;

1 个答案:

答案 0 :(得分:1)

2件事:

  1. trustAsHtml不是代码中的函数。所以你不能传递参数
  2. 设置
  3. $ scope.trustAsHtml = $ sce.trustAsHtml(procedure.description [0] .answer);

     ng-bind-html= "trustAsHtml|limitTo:100"
    

    使用此链接:http://jsfiddle.net/4x6z283a/1/