相关疑难解决方法(0)

ng-bind-html给出了无限的摘要错误($ rootScope.infdig)

如果我使用常规功能ng-bind,一切似乎都很好.但如果我使用ng-bind-html,我会收到无限的摘要错误.

=== View ===
1. <span ng-bind="test()">
2. <span ng-bind-html="test()">

=== Controller ===
1. $scope.test = function() {
       return 1;
   }  

2. myapp.controller('myapp', function($scope, $sce) {
    $scope.test = function() {
        return $sce.trustAsHtml('<input></input>');
    }
});
Run Code Online (Sandbox Code Playgroud)

知道这里发生了什么吗?视图确实呈现输入,但抛出无限错误摘要错误.文档也不是很有帮助.

angularjs

8
推荐指数
1
解决办法
3044
查看次数

标签 统计

angularjs ×1