Greg Zuber
Greg Zuber

Reputation: 1279

Angular binding to object field

I'm using angular with ng-repeat like that:

<tr ng-repeat="(fieldName, fieldValue) in publication">
    <td>
        <input type="text" ng-value="publication[fieldName]">
    </td>
</tr>

But binding doesn't work - so after change I have still old values in publication[fieldName]. How can I achieve binding?

Upvotes: 0

Views: 172

Answers (1)

Tarun Dugar
Tarun Dugar

Reputation: 8971

It should be ng-model instead of ng-value if you want a data binding.

Upvotes: 3

Related Questions