Ok, I'm sure this one is super simple, though it's evading me.
I have a very simple dropdown select menu - as shown below - with predefined options.
I am setting the $scope.qty in my controller and it correctly selects the appropriate <option>
However, in my controller, on a save() function, when I get the value of $scope.qty i get the original value, that i set earlier, and not the newly selected on.
What I am missing to bind my 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 qty
$scope.qty = 4;
When I change my select, to say 2, $scope.qty still equals 4.
ng-optionsdirective instead. I am sure it will work as expected.ngModelonselectrequiresngOptionsto handle the case you are trying to accomplish.