Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 33f7f26

Browse files
committed
docs(ngChecked): note that it shouldn't be used with ngModel
Closes #11106
1 parent e27eed3 commit 33f7f26

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ng/directive/attrs.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@
206206
* @priority 100
207207
*
208208
* @description
209+
* Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.
210+
*
211+
* Note that this directive should not be used together with {@link ngModel `ngModel`},
212+
* as this can lead to unexpected behavior.
213+
*
214+
* ### Why do we need `ngChecked`?
215+
*
209216
* The HTML specification does not require browsers to preserve the values of boolean attributes
210217
* such as checked. (Their presence means true and their absence means false.)
211218
* If we put an Angular interpolation expression into such an attribute then the
@@ -230,7 +237,7 @@
230237
*
231238
* @element INPUT
232239
* @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
233-
* then special attribute "checked" will be set on the element
240+
* then the `checked` attribute will be set on the element
234241
*/
235242

236243

0 commit comments

Comments
 (0)