fix($parse): do not pass scope/locals to interceptors of one-time bindings
This commit is contained in:
+1
-1
@@ -1907,7 +1907,7 @@ function $ParseProvider() {
|
||||
if (isDone(lastValue)) {
|
||||
scope.$$postDigest(unwatchIfDone);
|
||||
}
|
||||
return post(lastValue, scope, locals);
|
||||
return post(lastValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3246,6 +3246,20 @@ describe('parser', function() {
|
||||
expect(args).toEqual([1]);
|
||||
}));
|
||||
|
||||
it('should only be passed the intercepted value when wrapping one-time', inject(function($parse) {
|
||||
var args;
|
||||
function interceptor(v) {
|
||||
args = sliceArgs(arguments);
|
||||
return v;
|
||||
}
|
||||
|
||||
scope.$watch($parse('::a', interceptor));
|
||||
|
||||
scope.a = 1;
|
||||
scope.$digest();
|
||||
expect(args).toEqual([1]);
|
||||
}));
|
||||
|
||||
it('should only be passed the intercepted value when double-intercepted',
|
||||
inject(function($parse) {
|
||||
var args1;
|
||||
|
||||
Reference in New Issue
Block a user