angular中的ng-disabled

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="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>
posted @ 2016-11-10 18:21  LLBBJJ  阅读(2644)  评论(0编辑  收藏  举报