Table of Contents
Ng-disabled Directive in Angularjs: HTML DOM Element in Angularjs is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.
The following AngularJS directives can help bind application data to attributes in the HTML DOM element.
- ng-disabled: Disabling a control (control) provided
- ng-show: Displays a control provided
- ng-hide: Hide a control provided
- ng-click: Performing a click event in AngularJS
Ng-disabled Directive in AngularJS
Add ng-disable attribute to an HTML button and attach this data to the model. Mount the model to a checkbox to observe the change.
type = "checkbox" ng-model = "enableDisableButton" > Disable button
Ng-show Directive in AngularJS
Add the ng-show attribute to the HTML button and attach it to the model. Mount the model to a checkbox to observe the change.
type = "checkbox" ng-model = "showHide1" > Show button
Ng-hide directive in AngularJS
Add ng-hide attribute to the HTML button and attach it to the model. Mount the model to a checkbox to observe the change.
type = "checkbox" ng-model = "showHide2" > Hide the button
Ng-click directives in AngularJS
Add the ng-click attribute to the HTML Button and attach it to the model. Mount the model to hmtl to observe the change.
Total clicks: {{clickCounter}}
For instance,
Here is an example for the description mentioned above.
phantuHTMLDOM.html
HTML DOM trong AngularJS
For instance,
AngularJS QTMng-app = "" >border = "0" > type = "checkbox" ng-model = "enableDisableButton" > Vô hi?u hóa nút