You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This is something not handled correctly by 25f008f which started shallow-watching the inputs to object/array literals (even if those inputs are non-simple). But in some cases those inputs might go through filters which change output based on non-shallow state.
Before 25f008f such expressions would throw an infdig error so this is not a regression. However once ng-class started using this it caused one version of #15905 (the other version would be nested objects, this is the objects-passed-to-filters version).
Here is a test showing this problem (can be pasted into parserSpec.js):
it('should reevaluate filters in literals with non-primitive',inject(function($parse){varfilterCalls=0;$filterProvider.register('xy',valueFn(function(input){filterCalls++;returninput.x+input.y}));varwatchCalls=0;scope.$watch("{key: (value | xy)}",function(){watchCalls++;});scope.$apply("value = {x: 1, y: 1}");expect(filterCalls).toBe(1);expect(watchCalls).toBe(1);scope.$apply();expect(filterCalls).toBe(2);expect(watchCalls).toBe(1);scope.$apply("value.x = 2");expect(filterCalls).toBe(3);expect(watchCalls).toBe(2);}));
Note: interceptors and filters need the same fix in order to solve #15905