Skip to content

Commit

Permalink
docs(ngChecked): note that it shouldn't be used with ngModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Narretz committed Jun 22, 2015
1 parent e27eed3 commit 33f7f26
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ng/directive/attrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@
* @priority 100
*
* @description
* Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.
*
* Note that this directive should not be used together with {@link ngModel `ngModel`},
* as this can lead to unexpected behavior.
*
* ### Why do we need `ngChecked`?
*
* The HTML specification does not require browsers to preserve the values of boolean attributes
* such as checked. (Their presence means true and their absence means false.)
* If we put an Angular interpolation expression into such an attribute then the
Expand All @@ -230,7 +237,7 @@
*
* @element INPUT
* @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
* then special attribute "checked" will be set on the element
* then the `checked` attribute will be set on the element
*/


Expand Down

0 comments on commit 33f7f26

Please sign in to comment.