@@ -939,14 +939,14 @@ var VALID_CLASS = 'ng-valid',
939
939
* Note that if you have a directive with an isolated scope, you cannot require `ngModel`
940
940
* since the model value will be looked up on the isolated scope rather than the outer scope.
941
941
* When the directive updates the model value, calling `ngModel.$setViewValue()` the property
942
- * on the outer scope will not be updated.
942
+ * on the outer scope will not be updated. However you can get around this by using $parent.
943
943
*
944
- * Here is an example of this situation. You'll notice that even though both 'input' and 'div'
945
- * seem to be attached to the same model, they are not kept in synch .
944
+ * Here is an example of this situation. You'll notice that the first div is not updating the input.
945
+ * However the second div can update the input properly .
946
946
*
947
947
* <example module="badIsolatedDirective">
948
948
<file name="script.js">
949
- angular.module('badIsolatedDirective', []).directive('bad ', function() {
949
+ angular.module('badIsolatedDirective', []).directive('isolate ', function() {
950
950
return {
951
951
require: 'ngModel',
952
952
scope: { },
@@ -961,8 +961,9 @@ var VALID_CLASS = 'ng-valid',
961
961
});
962
962
</file>
963
963
<file name="index.html">
964
- <input ng-model="someModel">
965
- <div bad ng-model="someModel"></div>
964
+ <input ng-model="someModel"/>
965
+ <div isolate ng-model="someModel"></div>
966
+ <div isolate ng-model="$parent.someModel"></div>
966
967
</file>
967
968
* </example>
968
969
*
0 commit comments