title: Implementing ngClassEven ngClassOdd for angular 2
body: <p>I tried to implement ng-class-even and ng-class-odd ( from angular 1) type behaviour in angular 2 application.</p>
  
  <p>I have written the code below and its working fine, I want to know if there is any other way of doing this.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div *ngFor="#employee of employees; #index = index" [class.odd]="index%2==1" [class.even]="index%2==0" [class.selected]="employee === selectedEmployee"&gt; 
        &lt;p&gt;{{employee.name}}&lt;/p&gt;
           &lt;/div&gt;
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code>.odd {
      background-color: #f2f9ff;
  
  }
  .even {
      background-color: #eceff3;
  }
  </code></pre>