如果我使用常规功能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 ×1