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>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM