title: angularjs multiple html selects changes selected when one is changed
body: <p>I'm using angular and have created a table using information gathered from a Mongodb. In the last column of the table I've placed a select, so there is one select for each row. The problem is that when I run the app and pick an option in any row, all other selects changes to have the same option as selected. How do I change so that I can pick an option in any select without changing the others as well?  </p>
  
  <p>The code will follow below but first are some code clarifications regarding the information gathered from the database. </p>
  
  <pre><code>vm.user = current user
  vm.years = all years stored to all users in the database (shitty solution but do for now).
  vm.courses = all courses in the database 
  </code></pre>
  
  <p>In the selects the user will have the option to choose to which of the users years it wants to add the course. (No add-button atm but will be implemented later). But when any selection is made in any of the selects, all selects change. </p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;table class="table" style="width:100%"&gt;
              &lt;tr&gt;
                  &lt;th&gt;Course Code&lt;/th&gt;
                  &lt;th&gt;Course Name&lt;/th&gt;
                  &lt;th&gt;Term&lt;/th&gt;
                  &lt;th&gt;Block&lt;/th&gt;
                  &lt;th&gt;Credits&lt;/th&gt;
                  &lt;th&gt;Institution&lt;/th&gt;
                  &lt;th&gt;Add to Year&lt;/th&gt;
              &lt;/tr&gt;
  
              &lt;tr ng-repeat="course in vm.courses|filter:search"&gt;
                  &lt;td&gt;{{course.courseCode}}&lt;/td&gt;
                  &lt;td&gt;{{course.courseName}}&lt;/td&gt;
                  &lt;td&gt;{{course.term}}&lt;/td&gt;
                  &lt;td&gt;{{course.block}}&lt;/td&gt;
                  &lt;td&gt;{{course.credits}}&lt;/td&gt;
                  &lt;td&gt;{{course.department}}&lt;/td&gt;
                  &lt;td&gt;&lt;select  id="{{course._id}}" name="{{course._id}}" class="form-control"  ng-model="vm.add.year" required&gt;
                          &lt;option value="" selected&gt; Ej valt&lt;/option&gt;
                          &lt;option ng-repeat="year in vm.years" ng-if="year.user==vm.user._id" value="{{year.year}}"&gt;{{year.year}}&lt;/option&gt;
                      &lt;/select&gt;&lt;/td&gt;                 
                &lt;/tr&gt;
          &lt;/table&gt;
  </code></pre>