VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/how-to-disable-buttons-using-angularjs/

⇱ How to disable buttons using AngularJS ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to disable buttons using AngularJS ?

Last Updated : 23 Jul, 2025

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:

  • expression: It represents an expression that returns true if it sets the disabled attribute for the element.

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:

👁 Image
 

Example 2: This example illustrates the implementation of the ng-disabled directive to disable multiple buttons.

Output:

👁 Image
 
Comment
Article Tags:

Explore