Ng-Disable-1

 

In this example of the ng-disabled directive we have a textbox and upon the textbox we have a link toggle when you click on this it will disable the textbox and the link below the textbox both, click again to make both enable.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app> <div ng-init="count=1;inactive=false"> <a ng-click="inactive = !inactive" href="">Toggle Active</a> Disable={{inactive}} <br><input type="number" ng-disabled="inactive" ng-model="count"> <br><a ng-click="inactive || (count=count + 1)" href="" style="">click to Increase count</a> {{count}} </div> </body> </html>
Output