I have a select box populated with data from my backend. This data is an array of objects:
[Object { superkund_id="4", nod_id="12068", namn="Växjö Fagrabäck"}, Object { superkund_id="5", nod_id="9548", namn="Halmstad Bågen / Pilen"}]
I am using ng-options to generate the options in the select box:
<td><select class="form-control input-sm2" ng-model="selectedSupercustomer" ng-options="item.superkund_id as item.namn for item in superkundOptions" ng-change="onChangeSuperCustomer(selectedSupercustomer)" ><option value=''>Select</option></select></td>
Currently, I am capturing the selected option using onChangeSuperCustomer:
$scope.onChangeSuperCustomer = function(selectedSupercustomer) {
//console.log(selectedSupercustomer);
}
What I actually want is to pass the entire object related to the selected option so that I can access all its properties. How can I achieve this?