title: angularjs - how to populate html select element options based on primitive not model
body: <p>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.</p>
  
  <p>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)</p>
  
  <p>My code so far is as follows:</p>
  
  <p>HTML snippet:</p>
  
  <pre><code>&lt;input ng-model="totalApples" /&gt;
  &lt;select ng-options=""&gt;
    &lt;option value="1"&gt;1&lt;/option&gt;  //what I would like to have is the options generated 
    &lt;option value="2"&gt;2&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>In my controller I set the scope:</p>
  
  <pre><code> $scope.totalApples = 2;
  </code></pre>
  
  <p>Thank you</p>