title: Angular 4+. Assign value to variable
body: <p>Im trying to assign a variable in my html in angular 4+. Is this possible?</p>
  
  <p>What im trying to achieve is to assign a comparison to a variable, so i do not have to make always the same in all the cases i have.</p>
  
  <p>Here is an example i want to achieve:</p>
  
  <pre><code>&lt;mat-list-item role="list" *ngFor="let o of examles;" role="listitem"&gt;
  
       &lt;span *ngIf="o.type == 'EXAMPLE_TYPE'"&gt; some text&lt;/span&gt;
   // here more divs
       &lt;span *ngIf="o.type == 'EXAMPLE_TYPE'"&gt; other text&lt;/span&gt;
   // more divs...
       &lt;span *ngIf="o.type == 'EXAMPLE_TYPE'"&gt; last text&lt;/span&gt;  
  
  &lt;/mat-list-item&gt;
  </code></pre>
  
  <p>So, my question is, is there any way to declare something like?</p>
  
  <pre><code>&lt;div #isExampleType="o.type == 'EXAMPLE_TYPE'" &gt;
  </code></pre>
  
  <p>And then use it in the *ngIf="isExampleType"...</p>