This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngModelOptions does not recognise dynamically generated accessors #8704
Closed
Description
Consider this scenario.
$scope.accessor = function(object, property) {
return function(value) {
if ( angular.isDefined(value) ) {
object[property] = value;
}
else {
return object[property];
}
}
};
<input type="text" ng-model="accessor(user, 'name')" ng-model-options="{ getterSetter: true }" />
It throws the nonassign exception:
Expression 'accessor(user, 'name')' is non-assignable.
Is this a designed feature? Is so, is there a way I can bind to dynamic scope paths?