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
0
votes
1 answer

What is the 'AngularJS' way to disable an 'option' HTML5 element?

What is the 'AngularJS' way to disable an 'option' HTML5 element? I'm using AngularJS v1.2.25. Plunk Link: https://plnkr.co/edit/fS1uKZ