Reputation: 2471
I have a enum
value that I get from a REST-Service, and I am trying to print in in a table
<td *ngIf="door.doors==Pass">No error</td>
In this case, doors
is the enum
.
I have tried to make the condition in different ways:
1 - ==
<td *ngIf="door.doors==Pass">No error</td>
2- ===
<td *ngIf="door.doors===Pass">No error</td>
3 - =
<td *ngIf="door.doors=Pass">No error</td>
But any of them are working (nevers appear the td). I guess that the problem is that I am comparing a String
(Pass) with a enum
. Any suggestion?
Upvotes: 0
Views: 884
Reputation: 68665
Use ==
and ''
with the Pass
. ==
will force the doors
to be cast into string and check their values based on string.
<td *ngIf="door.doors == 'Pass'">No error</td>
Upvotes: 1