title: Add class based on some condition Angular2
body: <p>I am working with ng2 project and I need a help with one task, where should I add css class, only for one item from array.</p>
  
  <p>I got sommething like this: </p>
  
  <pre><code>&lt;div class="ds-photo__item" *ngFor="let albumPhoto of albumPhotos"&gt;
    &lt;div class="ds-photo__item--cover"&gt;
      &lt;img class="ds-photo__item--cover-photo" [src]="albumPhoto.url" alt="" (click)="choseCover(albumPhoto)" [class.selected]="..."&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And I need add class select only for one item which is choosen by function below: </p>
  
  <pre><code>selectCover() {
      if (this.album.cover) {
          this.cover = this.albumPhotos.find( photo =&gt; photo.id === this.album.cover );
          console.log("COVER: ", this.cover);
          this.isCover = true;
      } else { this.isCover = false }
  }
  </code></pre>
  
  <p>after that, I have one object with current cover of album. I need to add class "selected" to listed item, whuch is actualy cover.</p>
  
  <p>I need something like this: 
  [class.selected]="if albumPhoto.id === cover.id" </p>
  
  <p>or sommething similar. There is possible to pass function, not only variable in <code>[class.my-class]</code>?</p>
  
  <p>Please for hints!
  Regards Greg</p>