HTML DOM element in AngularJS
The directives below can be used to bind application data to attributes in the HTML DOM element.
The following AngularJS directives can be used to 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 example
Here is an example for the description mentioned above.
phantuHTMLDOM.html
HTML DOM trong AngularJS
For example
AngularJS QTMng-app = "" >border = "0" > type = "checkbox" ng-model = "enableDisableButton" > Vô hiệu hóa nút