title: How to change buttons class by click?
body: <p>I have script pushing (and splice) data to and from array. </p>
  
  <p><a href="http://plnkr.co/edit/EuFdfCLNIXKreNiADXy3?p=preview" rel="nofollow">Plunker</a></p>
  
  <pre class="lang-ts prettyprint-override"><code> &lt;button
    *ngFor="#color of colors"
     [class.selected]="???????????" (click)="onPress(color)"&gt;
         {{color.name}}
   &lt;/button&gt;
  </code></pre>
  
  <p>app.ts</p>
  
  <pre class="lang-ts prettyprint-override"><code>onPress(color: Color) {
   this.selectedColors = color;
    if (this.hasColor(this.colorsArray,this.selectedColors.id)) {
      this.colorsArray.splice( this.colorsArray.indexOf(this.selectedColors.id),1);
    }
    else {
      this.colorsArray.push(this.selectedColors.id);
           }   
    }
  </code></pre>
  
  <p>How can i change class on all pressed buttons by click and change it back? Not switch (<a href="https://angular.io/docs/ts/latest/tutorial/toh-pt3.html" rel="nofollow">like here</a>) 
  Should i use ngClass or something like <code>[class.selected] ===</code> </p>
  
  <p><a href="http://plnkr.co/edit/EuFdfCLNIXKreNiADXy3?p=preview" rel="nofollow">Plunker</a></p>