I have a following collection of fields.
$scope.fields = ['name','postcode','phone'];
I need to have input controls dynamically generated as many as the fields above. So a fixed version of below
<div class="col-sm-3" ng-repeat="user in users">
<div ng-repeat="field in fields">
<input class="form-control" ng-model="user.field" /> <!-- .field isn't resolving -->
</div>
</div>
would hopefully generate something like below...
<div class="col-sm-3" ng-repeat="user in users">
<div><input class="form-control" ng-model="user.name" /></div>
<div><input class="form-control" ng-model="user.postcode" /></div>
<div><input class="form-control" ng-model="user.phone" /></div>
</div>
Any ideas? Thanks!
usercoming from?fieldis not a property ofuserin the example you are giving so it won't work..