AngularJS - nested ng-repeat with select/option, get/set the selected value
<p>I am trying to set two ng-repeat loops, one of which, the nested one, is a select/option drop down. I checked other similar posts, but still not sure how to define the ng-model in HTML to get/set the default value/option in the select box. </p>

<pre><code>    &lt;table&gt;
      &lt;tr ng-repeat="student in studentList"&gt;
        &lt;td&gt;{{student.name}}&lt;/td&gt;
        &lt;td&gt;
          &lt;select ng-model="courseSelected"&gt;
            &lt;option ng-repeat="course in courseList" value="{{course.id}}"&gt;{{course.name}}&lt;/option&gt;
          &lt;/select&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
   &lt;/table&gt;
</code></pre>

<p>Both studentList and courseList come from the database tables, and the student table/object has a courseId column/reference. In other words, the default selected course and the changed course option (if this happens) would have the logic behind them : student.courseId = course.id</p>

<p>Any help is appreciated.</p>