Angular 2: Pass a function to the ngClass tag on the template
<p>I have done some searching on this but haven't come across anything that works.</p>

<p>When i pass a function to the ngStyle i get the following error:</p>

<p><code>Expression 'getClass()' in ProductView has changed after it was checked.</code></p>

<p>My Template looks like:</p>

<pre><code>&lt;div class="itemContainer"&gt;
    &lt;div class="well imageHolder" [ngClass]="getClass()"&gt;
        &lt;img [src]="'img/thumbs/' + item.images[0]" class="productImage" id="productImage"&gt;
    &lt;/div&gt;
&lt;/div&gt; 
</code></pre>

<p>Im not sure what would fix this or even if it can currently be done. I have noticed that this error also occurs with ngStyle.</p>

<p>All help would be appreciated.</p>