Reputation: 35
Are null
, undefined
and ""<empty string>
value treated similarly by *Ngif?
For example, is this:
*ngIf = "foo == null"
Treated the same as:
*ngIf = "foo == undefined"
If not, is there a simpler way to use *ngIf to not show properties with the value null, undefined, and ""?
Upvotes: 2
Views: 6097
Reputation: 377
You can solve this also by using
null === undefined // false
null == undefined // true
by the use of strict comparison operator
Upvotes: 1
Reputation: 1112
You can simply check *ngIf = "foo" that can check undefined and null or empty.
Upvotes: 2