title: Using the method in ngclass results Expression has changed after it was checked
body: <p>I am using the method in the ngclass which loops in the ngfor.
  All the time the method return value changes when the looping does.</p>
  
  <p>But i am getting an error like </p>
  
  <blockquote>
    <p>ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression
    has changed after it was checked. Previous value: 'background_pink'.
    Current value: 'background_blue'.</p>
  </blockquote>
  
  <p>The code is like this</p>
  
  <p>component.ts</p>
  
  <pre><code>getRandomColor() {
      const changedColor = _.sample(this.colors);
      return changedColor;
  }
  </code></pre>
  
  <p>component.html</p>
  
  <pre><code>&lt;a href="https://www.leelag.com/tag/laravel" *ngFor="let tag of bookDetails.tags"&gt;
  &lt;label [ngClass]="['label', 'well', 'well-sm', getRandomColor()]"&gt;{{ tag.name }}&lt;/label&gt;&lt;/a&gt;
  </code></pre>
  
  <p>All the time when looping it is displaying the above error.
  How to solve this?</p>