Skip to content
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
@vicary

Description

@vicary

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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions