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