I have this array of objects:
var abc = [
{"id":28,"name":"Actions, State & Occurences"},
{"id":29,"name":"Descriptive Words & Modifiers"}
{"id":30,"name":"Counting & Measurement"},
{"id":31,"name":"Time & Dates"}]
Here's the select I am using:
{{ row.categoryId }}
<select class="select"
convert-to-number
ng-options="option.name for option in abc track by option.id"
ng-model="row.categoryId"></select>
The problem I have is that the row.categoryId is a number and the correct value is not being selected. When I do select a value here's what my row.categoryId gets set to:
{"id":28,"name":"Actions, State & Occurences"}
Can someone tell me is there a way I can make this work correctly so that it sets and uses the id value instead of the object?