Here’s my HTML form:
<select [(ngModel)]="bill.payMode">
<option value="credit" *ngIf="pay._id">Credit</option>
<option value="cash">Cash</option>
<option value="card">Card</option>
</select>
Here’s my TS file:
ngOnInit(): void {
this.patient.paymentMode = 'cash';
}
I want to put an if-else condition in the TS file wherein, if pay._id
is fulfilled, the default option shown is credit
and not cash
.
Note that credit
is hidden if pay._id
is not fulfilled.
How can I go about this?