I have a problem with ng-model on a select
element when passing an object from option
elements. So, imagine we have an array of columns from a table ca
You can use ng-options to bind the selected object to a model:
<div class="form-field" ng-repeat="filter in filters">
<select ng-options="column.name for column in columns" ng-model="filter.value">
<option value="" disabled>Choose filter</option>
</select>
<input type="text" ng-model="filter.value.name">
</div>
Plunker
Updated answer:
<div class="form-field" ng-repeat="filter in filters">
<select ng-options="column.name for column in columns" ng-model="filters[$index]">
<option value="" disabled>Choose filter</option>
</select>
<input type="text" ng-model="filters[$index].name">
</div>