Slide 27
Slide 27 text
DISABLED IF OCCUPIED
➤ Real time updates on
occupied and released seats
@ShmuelaJ
this.roomId$.pipe(
switchMap((id) => this.db.getSeatsUpdate(id)),
withLatestFrom(this.seatsSelectForm$)
).subscribe(([updates, form]) => {
... // iterate over the updates,
// get the rowId, seatId and value
const control = form.get(
['rows', rowId, 'seats', seatId]);
updateValue.occupied ?
control.disable({ emitEvent: false }) :
control.enable({ emitEvent: false });
}