In case of a table with no guest, it will ask for pax
This commit is contained in:
37
bookie/src/app/sales/pax/pax.component.ts
Normal file
37
bookie/src/app/sales/pax/pax.component.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pax',
|
||||
templateUrl: './pax.component.html',
|
||||
styleUrls: ['./pax.component.css']
|
||||
})
|
||||
export class PaxComponent implements OnInit {
|
||||
form: FormGroup;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<PaxComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: number,
|
||||
private fb: FormBuilder,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.form.setValue({
|
||||
pax: this.data
|
||||
});
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
pax: ''
|
||||
});
|
||||
}
|
||||
|
||||
accept(): void {
|
||||
const pax = this.form.value.pax;
|
||||
this.dialogRef.close(pax);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user