title: Angular 4 If condition based on the value received from API
body: <p>I would like to change the background color of a primeng datatable based on the value from the API.</p>
  
  <p>This is my array of part colors in object format that needs to match the party name being pulled from the API.</p>
  
  
  
  <pre class="lang-typescript prettyprint-override"><code>this.partyColours = [{liberal: 'red'},{pc: 'blue'},{ndp: 'ndp'},{green: 'green'}];
  </code></pre>
  
  <p>This is my HTML code:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;p-column field="politicalParty" header="Party" [filter]="true" filterMatchMode="equals" 
                                   [style]="background-color: {{partyColours}}"&gt;
    &lt;ng-template pTemplate="filter" let-col&gt;
        &lt;p-dropdown [options]="politicalParties" [style]="{'width':'100%'}" 
                    (onChange)="dt.filter($event.value,col.field,col.filterMatchMode)" 
                    styleClass="ui-column-filter"&gt;&lt;/p-dropdown&gt;
    &lt;/ng-template&gt;
  &lt;/p-column&gt;
  </code></pre>
  
  <p>As you can see that <code>"background-color: {{partyColours}}"</code> returns an error and I'm trying to figure out how to work the logic.</p>