title: How to store and use angular pipe result to add ngClass in html file
body: <p>What I am doing:</p>
  
  <p><strong>html file</strong></p>
  
  <pre><code> &lt;div *ngFor='let result of results'&gt;
      &lt;div [ngClass]='{"myclass": someArray | inArray:result.id}'&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p><strong>ts file:</strong></p>
  
  <pre><code>someArray = [1, 2, 3]
  
  results = [
  {id:1, name:'abc'},
  {id:2, name:'xyz'},
  {id:4, name:'pqr'}]
  </code></pre>
  
  <p><strong>Result</strong>: I never get assigned class.</p>
  
  <p>How can I store result of pipe in html file using "as" to use it in ngClass?</p>
  
  <p><strong>inArray (pipe)</strong>: Pipe returns true or false based on if value exists in array.</p>
  
  <p>Referred <a href="https://stackoverflow.com/questions/45410723/angular-2-add-style-based-on-pipe-result">Angular 2 add style based on pipe result</a>: </p>
  
  <p><strong>Update 1:</strong></p>
  
  <p><strong>inArray (pipe)</strong>: Pipe returns -1 or index value based on if value exists in array.</p>
  
  <p><strong>UPDATE 2:</strong>
  <a href="https://stackblitz.com/edit/angular-nevhxm-so-at45c1" rel="nofollow noreferrer">stackblitz</a> </p>