![]() |
VOOZH | about |
In this article, we will see how to disable the button using the particular directive in AngularJS. Sometimes, we need to disable the button, and link on the click event. This task can be accomplished by implementing the ng-disabled directive that is used to enable or disable HTML elements.
Syntax:
<element ng-disabled="expression"> Contents... </element>
Parameter value:
This directive can be utilized to set the form field such as input, select, or textarea, with having the disabled attribute, i.e. it is supported by <input>, <select>, and <textarea> elements.
Example 1: This example illustrates the ng-disabled directive by disabling the button.
Output:
Example 2: This example illustrates the implementation of the ng-disabled directive to disable multiple buttons.
Output: