title: displaying selected list of values from one list into another onclick in angularjs
body: <p>i have list of data displayed in table. As i click any td i display the list of selected values in another table.The Problem is if i select more than one row then in addition to the previous record next selected value should also be displayed but as per my code that do not happen.Should i use checklist? Or changes can be done in the existing one.code is as follows:</p>
  
  <pre><code>&lt;table class="table table-hover" style="width:300px;"&gt;
  &lt;tr ng-repeat="work in jointworkdata"&gt;
  
    &lt;td ng-click="selectedVal(tab,work.jointwork_name)"&gt;{{work.jointwork_name}}&lt;/td&gt;
    &lt;/tr&gt;
  </code></pre>
  
  <p></p>
  
  <p>and display table is:</p>
  
  <pre><code>&lt;table   class="table table-hover"&gt;&lt;tr&gt;
  &lt;td &gt;{{selectedData}}&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p></p>
  
  <p>code in controller is:</p>
  
  <pre><code>$scope.selectedVal = function(tab,val) {
  
          if(tab==1)
          {
  
           $scope.selectedData=val;}
           };
  </code></pre>
  
  <p>The output gives one record at a time and not all selected since fucntion is getting called on click.</p>