我写了一个使用AngularJS的网页
var app = angular.module("App", ['ngSanitize']);
app.controller("appCtrl", function ($scope, $http, $sce) {
$scope.data = {};
$http.get("/MyWebService/Action", ...).
success(function (data, status, headers, config) {
$scope.data.result = $sce.trustAsHtml(data);
});
}
Web服务的结果是带有一些输入框的html模板
<div>
...
<input type="Text" id="myId" ng-disabled="true"/>
...
</div>
结果是使用my.html
中的bg-bind-html绑定到div<div class="main ng-cloak" ng-controller="appCtrl">
<input type="text" id="testDisable" ng-disabled = "true">
...
<div id="myResult" ng-bind-html="data.result"></div>
...
</div>
文本框'testdisable'(在ng-bind-html之外)效果很好 但文本框'myId'(inisde ng-bind-html)未被禁用
如何让ng-disabled在ng-bind-html中工作?