Skip to content

Commit 303c7f9

Browse files
mrlucmorinpetebacondarwin
authored andcommitted
docs(input): provide explanation of how ngModel will affect the local scope
1 parent a95bfbe commit 303c7f9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ng/directive/input.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
10871087
* @element input
10881088
*
10891089
* @description
1090-
* Is directive that tells Angular to do two-way data binding. It works together with `input`,
1090+
* Is a directive that tells Angular to do two-way data binding. It works together with `input`,
10911091
* `select`, `textarea`. You can easily write your own directives to use `ngModel` as well.
10921092
*
10931093
* `ngModel` is responsible for:
@@ -1098,6 +1098,10 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
10981098
* - keeping state of the control (valid/invalid, dirty/pristine, validation errors),
10991099
* - setting related css class onto the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`),
11001100
* - register the control with parent {@link ng.directive:form form}.
1101+
*
1102+
* Note: `ngModel` will try to bind to the property given by evaluating the expression on the
1103+
* current scope. If the property doesn't already exist on this scope, it will be created
1104+
* implicitly and added to the scope.
11011105
*
11021106
* For basic examples, how to use `ngModel`, see:
11031107
*

0 commit comments

Comments
 (0)