HTML check variable undefined with ngIf excluding case when value is 0 September 20, 2023 by Tarik You can just write: *ngIf="testvar !== undefined"