Hello there!

I'm trying to use non-trivial expressions inside of *ngModel* directive in 
order to generate form elements dynamically (using *ngRepeat* loop).

However, it's not working as expected.

I've created a minimal Plunk 
<http://plnkr.co/edit/FeYTYPr9QVz1mOBCrJEL?p=preview> to demonstrate the 
idea.

Here's the code inside of my controller:

$scope.entity = {
  firstName: 'Jack',
  lastName: 'Bauer',
  location: {
    city: 'New York'
  }
};
$scope.path = 'location.city';


I've managed to display input field correctly with proper value this way:

<input type="text" ng-model="$eval('entity.' + path)">


However, I can't change the value. It's not editable. I'm getting the 
following error:

Error: ngModelSet is not a function

What could be the reason for this? Is there a way to solve my problem? I 
need to access property of the object using *property path*, e.g.: 
*user.location.city*.

I will gladly accept any suggestions, thank you!

---

Also, here's the question on SO 
<http://stackoverflow.com/q/33153769/1056679>.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to