title: AngularJs - allow only one item to be selected in Table
body: <p>I am using smart table. I have a logic behind where I only need one item to be selected. My current table code allow multiple lines to be selected.</p>
  
  <p><a href="https://i.stack.imgur.com/LvTMy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LvTMy.png" alt="enter image description here"></a></p>
  
  <p>This is my HTML:</p>
  
  <pre><code> &lt;table st-safe-src="flow3.dataSet" st-table="flow3.displayed" class="table table-striped"&gt;
  
                  &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th st-sort="method"&gt;Method&lt;/th&gt;
                      &lt;th st-sort="sample"&gt;Sample&lt;/th&gt;
                      &lt;th st-sort="parameters"&gt;Parameters&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody ui-sortable ng-model="flow3.displayed"&gt;
                  &lt;tr ng-repeat="row in flow3.displayed track by $index" style="cursor: move;" ng-click="row.selected = !row.selected; flow3.selectRow($event, row)" ng-class="{success: row.selected}"&gt;
                      &lt;td&gt;{{row.method.name}}&lt;/td&gt;
                      &lt;td&gt;{{row.sample}}&lt;/td&gt;
                      &lt;td&gt;
                          &lt;span ng-repeat="parameter in row.parameters"&gt;{{parameter.methodInputParameter.name}} : {{parameter.value}}&lt;br/&gt;&lt;/span&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;button type="button" ng-click="flow3.removeItem(row)"
                                  class="btn btn-danger btn-sm btn-round pull-right"
                                  ng-disabled="flow3.confirmDisabled"&gt;
                              &lt;i class="glyphicon glyphicon-trash"&gt;&lt;/i&gt;
                          &lt;/button&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>This is my JS:</p>
  
  <pre><code> flow3.selectRow = function($event, row) {
          flow3.selectedItem = row; 
  }
  </code></pre>