Well, this one seems like it should be an easy fix, but it's proving elusive.
I have a straightforward dropdown select menu - as displayed below - with predefined options.
In my controller, I am initializing the $scope.qty
, which correctly selects the appropriate <option>
However, when I try to retrieve the value of $scope.qty
in a save()
function, I continue to get the original value that was set initially rather than the newly selected one.
What step am I missing to properly bind the selected option to the model?
<select ng-model="qty">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
In my controller, I set the quantity
$scope.qty = 4;
Even after changing the selection to '2', $scope.qty
still displays '4'.