In my fields Buy/Sell and Quantity I enter a value for each field. I confirm via a button.
And I get my values...
<div class="card mb-4" *ngIf='currentView == 1 && order.quantity > 0 && order.sense != "" '>
<div class="card-body">
<div class="row ml-0 mb-4" >
<ng-container *ngIf="order.sense === 'A'">Buy {{ order.quantity }} </ng-container>
<ng-container *ngIf="order.sense === 'V'">Sell {{ order.quantity }} </ng-container>
</div>
My problem is that if I have 3 fields to complete, I have to retrieve another message:
How to I can adapt this line in in my code above
<ng-container *ngIf="order.sense === 'A'">Buy {{ order.quantity }} - Limite {{ order.limit }} </ng-container>
CodePudding user response:
You could do something like this assuming thatyou want to conditionally render order.limit
:
<ng-container *ngIf="order.sense === 'A'">
Buy {{ order.quantity }}
<span *ngIf="order.limit > 0">
- Limite {{ order.limit }}
</span>
</ng-container>