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>