I have a dataset of objects that I display using ng-options. I bind the value of the object ID to the value withtrack by
Currently, data values are included, but they are displayed with commas. For instance...
$scope.items = [
{ID: '2012', Title: 'Chicago'},
{ID: '2013', Title: 'New York'},
{ID: '2014', Title: 'Washington'},
];
<select ng-options="item.Title for item in items track by item.ID">
</select>
But it will do ...
<option value="2,0,1,2" label="Chicago">Chicago</option>
<option value="2,0,1,3" label="New York">New York</option>
Why are these commas added and how to remove them?
source
share