ng disabled Directive in AngularJS
ng-disabled
The ng-disabled directive binds AngularJS application data to the disabled attribute of HTML elements.
Syntax:-
< 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
AngularJS Intro
AngularJS Expressions
AngularJS Modules
AngularJS Directives
ng-model Directive
Data Binding
ng-controller
AngularJS Scope
Filters
Services
Tables in AngularJS
Select Boxes
ng-disabled
ng-show
ng-hide
Events
Radio Buttons
Animations