<!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>
转载于:https://www.cnblogs.com/liubaichi/p/6051959.html