title: How many time ngStyle is applied
body: <p>I am applying color to div element and i am changing color in cycle as follow</p>
  
  <pre><code> toogleColor()
  </code></pre>
  
  <p>{</p>
  
  <pre><code>if(this.color=='blue')
  {
    this.color="red"
    this.fontcolor='white'
    return
  }else if(this.color=='red'){
    this.color='white'
    this.fontcolor='black'
    return
  }else if(this.color=='white'){
    this.color='blue'
    this.fontcolor='white'
    return
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and I have setStyle() function as follow:</p>
  
  <pre><code>  setStyle(){
  this.toogleColor()
  return {
  
    'background-color':this.color,
    'height':'382px'
  }
  </code></pre>
  
  <p>}</p>
  
  <p>In my component html I binded style as follow:</p>
  
  <pre><code>&lt;div  [ngStyle]="setStyle()"  *ngFor="let element of array1"&gt;
  </code></pre>
  
  <p>But i am not Getting expected color cycle because  setStyle() funnction is called 4*number of element in array</p>