Basically, I have an input control element where you can enter the total number of apples you have and based on the number of apples I want to set the max number of mini-apple pies you can make (for every 1 apple you can make 1 mini-apple pie). The Angularjs documentation states to use ngOptions, but I just want to base it off a primitive (total number of apples) not a model.
So, if I have a totalApples value of 2, then I want to have 2 options generated (with one having the value of 1 and the other the value of 2)
My code so far is as follows:
HTML snippet:
<input ng-model="totalApples" />
<select ng-options="">
<option value="1">1</option> //what I would like to have is the options generated
<option value="2">2</option>
</select>
In my controller I set the scope:
$scope.totalApples = 2;
Thank you