我对 ng-disabled 有疑问,它适用于 chrome 和 firefox,但IE 11有问题
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My first app</title>
</head>
<body ng-app="myApp" ng-controller="myController as vm">
<input type="text" ng-model="vm.name" />
<button ng-disabled="vm.isBtnDisabled()">Button</button>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script>
var app=angular.module("myApp",[]);
app.controller("myController",["$scope", function($scope){
this.name="";
this.isBtnDisabled=function(){
return this.name.trim().length==0;
}
}]);
</script>
</body>
</html>
如果我犯了任何错误,请告诉我,谢谢。