I am very much upset trying with unsuccessful result.
There is an object array where inside the object there is/are a booking id/ids. Booking Id is an array inside the object. Booking Id hold 1 or more no. of booking id. I want to hide the booking id if there is only 1 booking id else I would like to display them.
How ever my code display all even if it is 1 or more.
getBookingIds(){
var myResult = this.customers;
for(var i=0; i<myResult.length; i++){
for(var j=0; j<myResult[i].bookingIds.length; j++){
if(myResult[i].bookingIds.length > 2) {
this.bookingId = true
} else {
this.bookingId = false;
}
}
}
}
HTML
<span class="bkidwrap" >
<span class="bkids" *ngFor="let myBookingId of customer.bookingIds">
<span class="bkid" *ngIf="bookingId">{{myBookingId}}</span>
</span>
</span>
