Tutorial 22 - Directive ng-disabled

How to use ng-disabled in angularjs?

This sample will help you know about using ng-disabled in AngularJS




 <html>  
   <head>  
     <title>Angular JS Model</title>  
     <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>  
     <script>  
       angular.module('MyForm', [])  
           .controller('myController', ['$scope', function($scope) {  
            }]);  
     </script>  
   </head>  
   <body ng-app="MyForm">  
           <div ng-init="isDisabled = false">  
             <button disabled="{{isDisabled}}">Disabled</button>  
 <label disabled="{{isDisabled}}">Disabled</label>  
            </div>    
  <br/>  
  <h3>other way </h3>  
  <p>  
  <button ng-disabled="endordis">Click Me!</button>  
  </p>  
  <p>  
  <input type="checkbox" ng-model="endordis">Button  
  </p>  
  </body>  
 </html>  


No comments:

Post a Comment

Popular Posts