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.
feat(ngModel): determine context for getter/setter bindings
When using a getter/setter function for ngModel, attempt to determine the appropriate context by
parsing the ngModel expression. If the context cannot be found, fallback to using the current scope.
For example, '<input ng-model="someObject.value" ng-model-options="{ getterSetter: true }">' will
use 'someObject' as the calling context.
Non-assignable ngModel expressions will always fallback to using the current scope as the context.
For example, '<input ng-model="someObject.getValueFn()" ng-model-options="{ getterSetter: true }">'
will invoke the result of 'someObject.getValueFn()' from the current scope.
Closes#9394
BREAKING CHANGE: previously, getter/setter functions would always be called from the global context.
This behaviour was unexpected by some users, as described in #9394, and is not particularly nice
anyways. Applications that relied on this behaviour can use `$window` instead of `this` to access
the global object... but they probably shouldn't be storing global state anyways!
0 commit comments