Questions tagged [angularjs-ng-disabled]

This directive sets the disabled attribute on the element if the expression inside ngDisabled evaluates to truthy. The attribute is `disabled` with a `d`.

Spelling Note: The attribute is disabled; the directive is ng-disabled;
Both include the letter d at the end.

A special directive is necessary because we cannot use interpolation inside the disabled attribute.

Erroneous

<div ng-init="isDisabled = false">
    <button disabled="{{isDisabled}}">Disabled</button>
</div>

Use instead:

<div ng-init="isDisabled = false">
    <button ng-disabled="isDisabled">Disabled</button>
</div>

Resources

93 questions
1
vote
1 answer

Disable button with checkbox in nested ng-repeat angularjs

I wanna disable the button with the checkbox in nested angularjs ng-repeat. I mean to Disable button in the current array of ng-repeat. My code looks like the below example, angular.module('test', []) .controller('myController', ['$scope',…
1
vote
1 answer

angular js code to disable buttons in form

We have a UIform (angular js) which has Edit button in each row. Edit button has a condition that only one row can be edited at a time. I need to insert another button at top to disable edit button in all the rows. Please assist. Current code: btn…
Sujith K
  • 11
  • 1
1
vote
1 answer

Disabling the Button for only a specific instance of ng-repeat

I have ng-repeat on a div that contains a button. Say the div repeats 5 times with 5 buttons. I want to disable the 2nd button when it is clicked. How can I disable the button at that index?
1
vote
1 answer

Is it possible to disable a button in angular js when there are any custom ng-message errors present in the form?

Is is possible to disable a button in a form, when there is any error message in the form other than built in errors such as 'required', 'min-length', such as validating a condition?
Haripriya
  • 48
  • 4
1
vote
2 answers

Uncheck a checkbox when it is ng-disabled AngularJS

I have this dropdown with three roles: Super Admin Admin User And this checkbox that sets some extra privileges Give extra privileges. What I want to achieve is this: When the User role is selected in the dropdown, the checkbox is BOTH disabled…
w0ns88
  • 344
  • 2
  • 9
  • 28
1
vote
1 answer

ng-disable not working in a radio button div

I have a radio button div here that I would like to disable if yAxisEditorCtrl.forceCombinedYAxis is true. Here's the code before my change
theGreenCabbage
  • 5,197
  • 19
  • 79
  • 169
1
vote
1 answer
1
vote
3 answers

ng-disabled within angular directive

I have an angular directive: angular.module("app").directive("myButtons", function () { return { restrict: "E", scope: { bdisabled: '=' }, templateUrl: "buttons.html" } }); template:
Sun
  • 4,458
  • 14
  • 66
  • 108
1
vote
2 answers

How to disable angular material component md-chips?

I have read angular material documentation and they have readonly attribute to disable the element. But I can't get it to work, is there any other Angular Material approach that I can use? I want to disabled element by default. main.html
hussain
  • 6,587
  • 18
  • 79
  • 152
1
vote
2 answers

Angularjs ng-disabled

I have two inputs for validating email and password. I can see individuals of the following works: myForm.$error.required validating input form with required input value and myForm.email.$valid validating my regex email If i was to print i.e.…
1
vote
1 answer

Disable list item - angularjs

I'm creating a breadcrumb navigation in AngularJS. Some links should be disabled because the user didn't meet the requirements. I've looked into the angular documentation and I figured out that you can't use ng-disabled on a list-item. So i'm using…
Brent Theunckens
  • 105
  • 1
  • 13
1
vote
1 answer

How to make a input disabled by default using angular directives

How do I make a textual input field disabled by default and have it toggled using a checkbox. I am getting the checkbox to toggle the input field between an enabled and a disabled state but I cannot get the input field to be disabled by default even…
1
vote
2 answers

AngularJS input text disabled by select option

I've a simple form with a ; what I need is to disable the input text if the value of an option is true. This is my code:
ilGiudice
  • 63
  • 1
  • 9
1
vote
2 answers

Disabling button when data entered is not in database

What will be the best way to keep “Save” button disable until a valid Instruction Text is entered? I tried using ng-disable on “Save” button but it become activated once I put something in the input field. HTML
1
vote
1 answer

Make button disabled by changing object property

On button click I wan't to disable all buttons to prevent any other operation. For this I use request.isProcessing bool value. In the beginning function approve(request) I set request.isProcessing to true and In the end to false. But this doesn't…
demo
  • 6,038
  • 19
  • 75
  • 149