What is the efficient way to preselect an option based on some filter? My elements are e.g.:
[ {"name":"CSS1-1","id":"ce5e6a4299c68f0407b277fed38b4c657f20cfe8"},
. . .
{"name":"CSS1-2","id":"00f75732b5760a5bb36842e1db950d243bec87db" ]
and I want the element with id= 00f75732b5760a5bb36842e1db950d243bec87db preselected. In html
<select ng-model="currentCss"
ng-options="item.name for item in csss" />
</select>
Data filled in here:
$scope.getCsss = function () {
$http.get('/csss')
.success(function (data, status, headers, config) {
$scope.csss = data;
$scope.currentCss = ? ? ?
// I can start looping and comparing,
//but there must be a better way
}). . .