AngularJS HTML DOM

In AngularJS, some directives can be used to bind application data to attributes of HTML DOM elements.

These directives are:

DirectiveDescription
ng-disabledIt disables a given control.
ng-showIt shows a given control.
ng-hideIt hides a given control.
ng-clickIt represents an AangularJS click event.

ng-disabled directive:The ng-disabled directive binds AngularJS application data to the disabled attribute of HTML elements. In the below code, it binds a model to a checkbox.

ng-show directive: The ng-show directive shows or hides an HTML element. In the below code, it binds a model to a checkbox.

ng-hide directive: The ng-hide directive hides or shows an HTML element. In the below code, it binds a model to a checkbox.

ng-click directive: The ng-click directive counts the total clicks an HTML element. In the below code, it binds a model to a checkbox.


Let's take an example to deploy the all above directives and test the variations:

See this example:

Test it Now
Next TopicAngularJS Forms




Latest Courses