AngularJS Directives

AngularJS Filters and Elements

AngularJS Tutorials

ng disabled Directive in AngularJS




The ng-disabled directive binds AngularJS application data to the disabled attribute of HTML elements.




< input ng-disabled="expression" >< /input >


Further Explanation:-


Value Description
expression An expression that will set the element's disabled attribute if it returns true.


Code Explanation:-


  • The ng-disabled directive binds the application data switch to the HTML button's disabled attribute.
  • The ng-model directive binds the value of the HTML checkbox element to the value of switch.
  • If the value of switch evaluates to true, the button will be disabled.
  • If the value of switch evaluates to false, the button will not be disabled.

Code Explanation

All Tutorials related to AngularJS Tutorials

All Sections related to AngularJS