AngularJS has directives for binding application data to the attributes of HTML DOM elements.
The ng-disabled directive binds AngularJS application data to the disabled attribute of HTML elements.
The ng-disabled directive binds the application data mySwitch to the HTML button's disabled attribute.
The ng-model directive binds the value of the HTML checkbox element to the value of mySwitch.
If the value of mySwitch evaluates to true, the button will be disabled:
If the value of mySwitch evaluates to false, the button will not be disabled:
The ng-show directive shows or hides an HTML element.
The ng-show directive shows (or hides) an HTML element based on the value of ng-show.
You can use any expression that evaluates to true or false:
|In the next chapter, there are more examples, using the click of a button to hide HTML elements.|
The ng-hide directive hides or shows an HTML element.