diff options
| author | Julien Bouquillon | 2013-11-28 00:38:47 +0100 | 
|---|---|---|
| committer | Pete Bacon Darwin | 2013-12-04 22:36:41 +0000 | 
| commit | 1e7675ad4c6dd472755be65fb21c1788afec5856 (patch) | |
| tree | a64202892931d07a1f9090b70cc30d2eb3d922f3 /src/ng/directive/input.js | |
| parent | 280b5ce3c069dc55d2c101a533390a1cdaddf493 (diff) | |
| download | angular.js-1e7675ad4c6dd472755be65fb21c1788afec5856.tar.bz2 | |
docs(input): remove deprecated isolated scope pitfall
The 1.2 release fixed the documented pitfall at 909cabd36d779598763cc358979ecd85bb40d4d7
by isolating only the isolated directive's scope.
Closes #5179
Diffstat (limited to 'src/ng/directive/input.js')
| -rw-r--r-- | src/ng/directive/input.js | 33 | 
1 files changed, 0 insertions, 33 deletions
| diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 8307f7e8..1d8d14ee 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -951,39 +951,6 @@ var VALID_CLASS = 'ng-valid',      </file>   * </example>   * - * ## Isolated Scope Pitfall - * - * Note that if you have a directive with an isolated scope, you cannot require `ngModel` - * since the model value will be looked up on the isolated scope rather than the outer scope. - * When the directive updates the model value, calling `ngModel.$setViewValue()` the property - * on the outer scope will not be updated. However you can get around this by using $parent. - * - * Here is an example of this situation.  You'll notice that the first div is not updating the input. - * However the second div can update the input properly. - * - * <example module="badIsolatedDirective"> -    <file name="script.js"> -		angular.module('badIsolatedDirective', []).directive('isolate', function() { -      return { -        require: 'ngModel', -        scope: { }, -        template: '<input ng-model="innerModel">', -        link: function(scope, element, attrs, ngModel) { -          scope.$watch('innerModel', function(value) { -            console.log(value); -            ngModel.$setViewValue(value); -          }); -        } -      }; -		}); -    </file> -    <file name="index.html"> -        <input ng-model="someModel"/> -        <div isolate ng-model="someModel"></div> -        <div isolate ng-model="$parent.someModel"></div> -    </file> - * </example> - *   *   */  var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', | 
