title: How to assign random class to *ngFor generated elements in the DOM?
body: <pre><code>  &lt;div *ngFor="let project of projects; let i = index;"&gt;
      &lt;div class="project-card details-complete */random class/*"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>I have predefined classes = ['teal', 'pink', 'green', 'orange', 'magenta']; When *ngFor populates the DOM I wanna randomly assign one of those classes. I have tried to implement by generating random 0-4 number in the component and assign [class]="randomClassName():className" but I am getting expression changed after checked errors. [ngClass] did not help as well. Is there any way to implement this using directive or other api's?</p>