Ng-Disable-2

 
In this example we have a button and a anchor link. When you click on the Anchor link it will show Anchor clicks below it and when you click on the button it will show the button clicks. We have a checkbox to disable the button clicks when the checkbox is checked the button will disable.
 
 
 
<!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> <h4>Click me to toggle: <input type="checkbox" ng-model="isChecked"></h4> <a href="" ng-disabled="isChecked" ng-click="anchorClicks=anchorClicks+1">ANCHOR</a> <button ng-disabled="isChecked" ng-click="buttonClicks=buttonClicks+1">BUTTON</button> <hr /> <p>Anchor Clicks: {{anchorClicks}}</p> <p>Button Clicks: {{buttonClicks}}</p> </div> </body> </html>
Output