Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc76e72

Browse files
mrlucmorinpetebacondarwin
authored andcommitted
docs(input): provide explanation of how ngModel will affect the local scope
1 parent 8dd23ad commit bc76e72

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
@@ -1051,7 +1051,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
10511051
* @element input
10521052
*
10531053
* @description
1054-
* Is directive that tells Angular to do two-way data binding. It works together with `input`,
1054+
* Is a directive that tells Angular to do two-way data binding. It works together with `input`,
10551055
* `select`, `textarea`. You can easily write your own directives to use `ngModel` as well.
10561056
*
10571057
* `ngModel` is responsible for:
@@ -1062,6 +1062,10 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
10621062
* - keeping state of the control (valid/invalid, dirty/pristine, validation errors),
10631063
* - setting related css class onto the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`),
10641064
* - register the control with parent {@link ng.directive:form form}.
1065+
*
1066+
* Note: `ngModel` will try to bind to the property given by evaluating the expression on the
1067+
* current scope. If the property doesn't already exist on this scope, it will be created
1068+
* implicitly and added to the scope.
10651069
*
10661070
* For basic examples, how to use `ngModel`, see:
10671071
*

0 commit comments

Comments
 (0)