I have a form with several hundred select elements. When the user saves the form I am saving off the JSON and when they reload it pulling it back down using a JS proxy. I am looking for a good / clean way for it to set the option value from the value in the JSON. Preferably without enumerating the array for each one of these and setting it based on the index where it matches the value.
template:
<div ng-app="myApp">
<div ng-controller="myCtrl">
<select ng-model="jsModel.selVal"ng-options="myVal.value for myVal in myValArr"/>
</div>
app.js:
var myApp = angular.module('myApp',[]);
function myCtrl($scope) {
$scope.myValArr = [{ value: 'Yes' }, { value: 'No' }];
$scope.jsModel = ({ selVal: 'Yes' }); // Returned from proxy call
}