Skip to content

Commit c5c9bed

Browse files
docs(ngDisabled): improve wording
Fixes angular#11032
1 parent 0356d72 commit c5c9bed

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/ng/directive/attrs.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,18 @@
159159
*
160160
* @description
161161
*
162-
* We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
162+
* The HTML specification does not require browsers to preserve the values of boolean attributes
163+
* such as disabled. (Their presence means true and their absence means false.)
164+
* If we put an Angular interpolation expression into such an attribute then the
165+
* binding information would be lost when the browser removes the attribute.
166+
*
167+
* For example, this code will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
163168
* ```html
164169
* <div ng-init="scope = { isDisabled: false }">
165170
* <button disabled="{{scope.isDisabled}}">Disabled</button>
166171
* </div>
167172
* ```
168173
*
169-
* The HTML specification does not require browsers to preserve the values of boolean attributes
170-
* such as disabled. (Their presence means true and their absence means false.)
171-
* If we put an Angular interpolation expression into such an attribute then the
172-
* binding information would be lost when the browser removes the attribute.
173174
* The `ngDisabled` directive solves this problem for the `disabled` attribute.
174175
* This complementary directive is not removed by the browser and so provides
175176
* a permanent reliable place to store the binding information.

0 commit comments

Comments
 (0)