Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 *ngIf statement with multiple values

Maybe an outdated question but I cant get it to work.

I have an *ngIF statement and i want to use multiple conditions like this:

*ngIf="expression && prototype?.valueType === 'Integer' && 'String'" 

How do I set this *ngIf with multiple conditions?

like image 357
Sireini Avatar asked Apr 19 '16 15:04

Sireini


1 Answers

This usually works fine.

The expression

*ngIf="expression && prototype?.valueType === 'Integer' && 'String'" 

seems a bit off.

Perhaps you want something like

*ngIf="expression && (prototype?.valueType === 'Integer' || prototype?.valueType === 'String'") 
like image 52
Günter Zöchbauer Avatar answered Oct 09 '22 23:10

Günter Zöchbauer