title: Adding row to a table causes dropdown function to duplicate
body: <p>I have created a table with a row that has three dropdowns</p>
  
  <p><strong>Drug  - Dose  - Period</strong></p>
  
  <p>I also created a button <strong>Add Drug</strong> that will add another row of the same dropdowns</p>
  
  <p>I am getting the data from a database and populating it in the dropdown</p>
  
  <p><strong>Exception</strong>: </p>
  
  <p>The dose dropdown changes depending on what the drug is. So I created a watcher to check when the <code>value</code> of the drug changes, and then created an array of the dose data called <code>$scope.array</code> and populated it in <code>$scope.selectedDose</code> which are the values inside the dose dropdown. So the first drug dose data is different than the second drug dose data. <strong>Please select the second drug and 5th drug from dropdown in jsfiddle and see how dose values changes</strong></p>
  
  <pre><code>$scope.$watch("value",  function() {
    $scope.array = $scope.value.dose_array.split(',');
    $scope.selectedDose = $scope.array[0];
  });
  </code></pre>
  
  <p><strong>Problem</strong>:</p>
  
  <p>If you play around with my JSFiddle link that I shared, you will find that when adding a drug with the button and selecting another drug from the first, the dose data of the first row changes too. The reason for that is because <code>$scope.selectedDose</code> is changing with any drug data from any row</p>
  
  <p>The solution that I thought of is creating an array of an array</p>
  
  <pre><code>$scope.selectedDose[rowIndex] = $scope.array[0];
  </code></pre>
  
  <p>with every row added, the dose dropdown will have its own <code>selectedDose</code> data. However it was complicated and was not able to accomplish it </p>
  
  <p>Any solutions for this problem ? I have added the JSFiddle and organized my code as much as possible. It should demonstrate my problem very well</p>
  
  <p><strong>JSFIDDLE</strong></p>
  
  <p><a href="http://jsfiddle.net/jq3fxx72/3/" rel="nofollow">http://jsfiddle.net/jq3fxx72/3/</a></p>