Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f0b3776

Browse files
committed
fix(ngModel): prevent internal scope reference from being copied
Fixes #15833
1 parent f4d0bb6 commit f0b3776

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

karma-shared.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function(config, specificOptions) {
66
autoWatch: true,
77
logLevel: config.LOG_INFO,
88
logColors: true,
9-
browsers: ['Chrome'],
9+
browsers: ['ChromeCanary'],
1010
browserDisconnectTimeout: 10000,
1111
browserDisconnectTolerance: 2,
1212
browserNoActivityTimeout: 30000,

src/ng/directive/ngModel.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ function NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $
281281

282282
this.$$currentValidationRunId = 0;
283283

284-
this.$$scope = $scope;
284+
//https://github.com/angular/angular.js/issues/15833
285+
//Prevent `$$scope` from being iterated over by `copy` when NgModelController is deep watched
286+
Object.defineProperty(this, '$$scope', {value: $scope});
285287
this.$$attr = $attr;
286288
this.$$element = $element;
287289
this.$$animate = $animate;

0 commit comments

Comments
 (0)