Ng-Readonly-5

 

We can disable the month 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="month" ng-model="month"> </div> </body> </html>
Output