title: How can i filter the json by a specific length and style this with ngClass?
body: <p>I work with mat-table in which I output data from a JSON. Now I would like to filter out all records that have an ID of length 5 and then style them in my  via ngClass. Can you tell me how this works?</p>
  <p>My Code:</p>
  <pre><code>// JSON-EXAMPLE
  
  {
      &quot;success&quot;: true,
      &quot;myJSON&quot;: {
          &quot;myList&quot;: [
    {
                  &quot;id&quot;: 102000,
                  &quot;name&quot;: Alex,
                  &quot;age&quot;: 15
              },
              {
                  &quot;id&quot;: 10200, // length 5
                  &quot;name&quot;: Peter,
                  &quot;age&quot;: 30
              },
              {
                  &quot;id&quot;: 12345, // length 5
                  &quot;name&quot;: Andrew,
                  &quot;age&quot;: 34
              },
             {
                  &quot;id&quot;: 31322323,
                  &quot;name&quot;: Clark,
                  &quot;age&quot;: 40
              },
  ]
  }
  }
  
  </code></pre>
  <pre><code>// TS
  
  public highlightedSpecialRows = null;
  
    private loadData() {
  this.myService.getData(param).subscribe(
  (resp: any) =&gt; {
  const data = resp.success ? resp.myJSON.myList : null;
  if (null !== data &amp;&amp; data) {
  .....
  const filterIdLength = 5; // define the length to filtering
  this.highlightedSpecialRows = data.filter((d) =&gt; `${d['id']}`.length &gt;= filterIdLength); // Here I wanted to filter the ids by length 5, unfortunately it didn't work. What is the reason?
  }
  }
  );
  
  }
  
  </code></pre>
  <pre><code>// HTML
   &lt;td mat-cell *matCellDef=&quot;let row; let i = index;&quot; [ngClass]=&quot;{ 'highlightedRows': this.highlightedSpecialRows&quot;}&gt;....&lt;/td&gt;
  </code></pre>