title: Set a background color on a given class using dynamic function
body: <p>I have a function, which is returning me a background color from a json file list, getBackground(items). I am using one component which adds automaticly a class name upon each item click (its a list combo box component), it adds class .item-radio-checked. 
  I want to find a way to set the background color via my function to this class, but I am not sure how, since this class is added only when user click over the item. I can use:</p>
  
  <pre><code>[style.background]="getBackground(items)"
  </code></pre>
  
  <p>but this applies to the background attribute of the item element, not to the class I want to trigger.
  Via css will not work, since its a static and I want the background color to be taken from my function. So it will be:</p>
  
  <pre><code>.item-radio-checked {
  background-color: $colorname;
  }
  </code></pre>
  
  <p>I know that i need to handle this via angular and over the DOM, not in the SCSS file, but I am not sure how. </p>
  
  <p><strong>I need to know each this is this class added to the item (has item been clicked) and apply the right dynamic color from my function to it</strong></p>