Reputation: 2116
I am trying to only show a div if certain scenario's happen.
I get 2 parameters
typeOfCollection
which can have 2 possible values called branch
or courier
duplicate
which can have 2 possible values called Y
or N
HTML
<div *ngIf="typeOfCollection === '...' && duplicate" === '...'>
</div>
I do not want to show the above div if typeOfCollection
is branch
and duplicate
is N
. For any other scenario, I want to show the div. Any idea how I can do it?
Upvotes: 2
Views: 30
Reputation: 3216
Have you tried?
<div *ngIf="typeOfCollection !== 'branch' || duplicate !== 'N'">
</div>
Upvotes: 0
Reputation: 1149
I imagine this would do it:
<div *ngIf="!(typeOfCollection === 'branch' && duplicate" === 'N')">...</div>
Upvotes: 1