How would I go about populating a select if I was using ng-options?
So I have something like,
<select ng-model="option.model"
ng-options="option as (option.firstVal + ' ' + option.secondVal)
for option in options>
<option value="">default</option>
The value in each option is an entire object and the ng-option is going through a collection of objects.
I need the value to be the entire object to be the value so I can't use ng-repeat. When I try to assign the model to the object itself,
$scope.option.model = option; //option is made elsewhere
It doesn't work. It'll populate the field with the default option.
[Edit 1] In this example, the dropdown should be selected to John Rambo, but instead it goes to the default
jsfiddle.net/brzxn8yt/1