Following directives can be used to bind application data to attributes of HTML DOM Elements.
Add ng-disabled attribute to a HTML button and pass it a model. Bind the model to an checkbox and see the variation.
<input type = "checkbox" ng-model = "enableDisableButton">Disable Button
ng-show directive<button ng-disabled = "enableDisableButton">Click Me!</button> Add ng-show attribute to a HTML button and pass it a model. Bind the model to an checkbox and see the variation.
<input type = "checkbox" ng-model = "showHide1">Show Button
ng-hide directive<button ng-show = "showHide1">Click Me!</button> Add ng-hide attribute to a HTML button and pass it a model. Bind the model to an checkbox and see the variation.
<input type = "checkbox" ng-model = "showHide2">Hide Button
ng-click directive<button ng-hide = "showHide2">Click Me!</button> Add ng-click attribute to a HTML button and update a model. Bind the model to html and see the variation.
<p>Total click: {{ clickCounter }}</p>
<button ng-click = "clickCounter = clickCounter + 1">Click Me!</button> |