Ng-Readonly-6

 

We can disable the numeric textbox when checkbox is checked because true value is bind to open variable which assigns to ng-readonly directive and vice versa.

 
 
 
<!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> <label>Disable month field : <input type="checkbox" ng-model="open"></label><br /> Month:<input ng-readonly="open" type="number" ng-model="number"> </div> </body> </html>
Output