@@ -951,39 +951,6 @@ var VALID_CLASS = 'ng-valid',
951
951
</file>
952
952
* </example>
953
953
*
954
- * ## Isolated Scope Pitfall
955
- *
956
- * Note that if you have a directive with an isolated scope, you cannot require `ngModel`
957
- * since the model value will be looked up on the isolated scope rather than the outer scope.
958
- * When the directive updates the model value, calling `ngModel.$setViewValue()` the property
959
- * on the outer scope will not be updated. However you can get around this by using $parent.
960
- *
961
- * Here is an example of this situation. You'll notice that the first div is not updating the input.
962
- * However the second div can update the input properly.
963
- *
964
- * <example module="badIsolatedDirective">
965
- <file name="script.js">
966
- angular.module('badIsolatedDirective', []).directive('isolate', function() {
967
- return {
968
- require: 'ngModel',
969
- scope: { },
970
- template: '<input ng-model="innerModel">',
971
- link: function(scope, element, attrs, ngModel) {
972
- scope.$watch('innerModel', function(value) {
973
- console.log(value);
974
- ngModel.$setViewValue(value);
975
- });
976
- }
977
- };
978
- });
979
- </file>
980
- <file name="index.html">
981
- <input ng-model="someModel"/>
982
- <div isolate ng-model="someModel"></div>
983
- <div isolate ng-model="$parent.someModel"></div>
984
- </file>
985
- * </example>
986
- *
987
954
*
988
955
*/
989
956
var NgModelController = [ '$scope' , '$exceptionHandler' , '$attrs' , '$element' , '$parse' ,
0 commit comments