Im trying to assign a variable in my html in angular 4+. Is this possible?
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.
Here is an example i want to achieve:
<mat-list-item role="list" *ngFor="let o of examles;" role="listitem">
<span *ngIf="o.type == 'EXAMPLE_TYPE'"> some text</span>
// here more divs
<span *ngIf="o.type == 'EXAMPLE_TYPE'"> other text</span>
// more divs...
<span *ngIf="o.type == 'EXAMPLE_TYPE'"> last text</span>
</mat-list-item>
So, my question is, is there any way to declare something like?
<div #isExampleType="o.type == 'EXAMPLE_TYPE'" >
And then use it in the *ngIf="isExampleType"...