mano manoj
mano manoj

Reputation: 245

how to use *ngIf 'not equal to' for checking condition

Is it possible to use != in ngIf? I have tried but it didn't work:

<div class="tranDetails tenPadding"  *ngIf="transDtlsObj?.txnHistory!='null'">

Upvotes: 1

Views: 19104

Answers (1)

Ajanth
Ajanth

Reputation: 2515

null is not equal to 'null', regardless of whether you use != or !==. *ngIf works fine for != operations, try removing the quotes in your code,that could be the issue,

<div class="tranDetails tenPadding"  *ngIf="transDtlsObj?.txnHistory!=null">

Upvotes: 4

Related Questions