I am trying to create form input with ng-repeat. Note: "customFields" is an array of field names: ["Age", "Weight", "Ethnicity"].
<div class="control-group" ng-repeat="field in customFields"> <label class="control-label">{{field}}</label> <div class="controls"> <input type="text" ng-model="person.customfields.{{field}}" /> </div> </div>
What is the best / correct way to install "ng-model"? I would like to send it to the server as person.customfields.'fieldname ' , where fieldname is obtained from the field in customFields.
angularjs angularjs-ng-repeat angularjs-directive
502502 Jul 25 '13 at 18:19 2013-07-25 18:19
source share