首页 > 代码库 > angular中的ng-disabled

angular中的ng-disabled

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src=http://www.mamicode.com/"angular-1.5.8.js"></script>
</head>
<body ng-app="mainApp" ng-controller="ngController">
<input type="text" ng-disabled="isDisabled"/>
</body>
<script>
var count=2;
angular.module("mainApp",[])
.controller("ngController",function($scope){
$scope.isDisabled=true;
var timed=setInterval(function(){
count--;
console.log(count);
if(count<0){
$scope.isDisabled=false;
$scope.$apply();
clearInterval(timed);
}
},3000)
})
//这是ng-disabled的用法;就是当注释文本框(不能再输入内容)-true,是false就是可以输入内容;
</script>
</html>

angular中的ng-disabled