I have a customer dropdown with nested json and saving the selected customer json object in the data base and retrieving it in the same format. Now when I set back the selected customer model with the retrieved json object, the customer drop is not getting selected to this new one and the drop down remains unselected. Please find the plunker at http://plnkr.co/edit/raUmvLDlgFbj1vHRlGeu?p=preview.
<select ng-model="myCustomer" ng-options="customer.name for customer in customers" >
</select>
Here I am saving myCustomer in database in the same format. After retrieving, I am assigning the json object back to it (here sampleCustObj). But the dropdown remains unselected even though myCustomer is assigned with sampleCustObj. How can I make dropdown selected with the sampleCustObj?