title: Angular How to make a multiple selection in a table
body: <p>I use Angular and bootstrap and I would like to be able to select multiple elements at the same time on a table. because I would like to use it to add more users at a time.</p>
  
  <p>file.component.html</p>
  
  <pre><code>  &lt;table class="table table-bordered table-striped" style="border: none;"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;td class="title-column"&gt;Id&lt;/td&gt;
                  &lt;td class="title-column"&gt;Nom&lt;/td&gt;
                  &lt;td class="title-column"&gt;Prenom&lt;/td&gt;
                  &lt;td class="title-column"&gt;Rôle&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tr *ngFor="let u of Utilisateur" (click)="setClickedRowList(u.id)" style="cursor: pointer;"
              [ngClass]="{'hvr-fade':!clickedList(u),'hvr-fade-selected': clickedList(u)}"&gt;
              &lt;td class="row-left title"&gt;{{u.id}}&lt;/td&gt;
              &lt;td class="row-mid title"&gt;{{u.nom}}&lt;/td&gt;
              &lt;td class="row-mid title"&gt;{{u.prenom}}&lt;/td&gt;
              &lt;td *ngIf="u.admin==false" class="row-right"&gt;&lt;/td&gt;
          &lt;/tr&gt;
   &lt;/table&gt;
  </code></pre>
  
  <p>file.component.ts</p>
  
  <pre><code> selectedRowList: string;
   utilisateurRole: Role;
   selectedId: string;
  
   setClickedRowList(id: string) {
    this.selectedRowList = id;
  }
  
   clickedList(index) {
  
    if(this.selectedRowList === index.id) {
     this.selectedId = index.id;
  
     this.utilisateurRole.admin = index.admin;
  
    return true;
    } else {
     return false;
    }
  
  }
  </code></pre>
  
  <p>If not, if you know a method or I can check</p>