title: Cannot read property 'find' of undefined in Angular
body: <p>I have this object <code>valuesColors</code> that I use in a function </p>
  
  <pre><code>export class CountryEnvelopeComponent implements OnInit {
    constructor() {}
    valuesColors: [
        {
          key: "&lt;75%";
          color: "#00965E";
        },
        {
          key: "&gt;=75%&amp;&lt;90%";
          color: "#ff9933";
        },
        {
          key: "&gt;90%";
          color: "#E61D00";
        }
      ];
    ngOnInit() {
    }
    getColor(value) {
      console.log(this.valuesColors);
      let element = this.valuesColors.find(elm =&gt; {
        return elm.key == value;
      });
      return element.color;
    }
  }
  </code></pre>
  
  <p>In HTML, inside a loop I change style using <code>getColor</code> function </p>
  
  <pre><code>&lt;div [style.background-color]="getColor(title.value)" class="badge circle-indicator"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I get this error: </p>
  
  <blockquote>
    <p>ERROR TypeError: Cannot read property 'find' of undefined</p>
  </blockquote>