Given an ng-model
as $scope.value = "b"
, how would I declare the syntax for ng-options
to be able to select and save the value
property of the following alternatives?
$scope.value = "b"
$scope.alternatives = [{
text: "A",
value: "a"
}, {
text: "B",
value: "b"
}, {
text: "C",
value: "c"
}];
What I want is that, when an option is selected, the model changes to lowercase "b". Currently it saves to the whole Object {"text":"B","value":"b"}