In case of a table with no guest, it will ask for pax

This commit is contained in:
Amritanshu
2019-08-26 15:11:28 +05:30
parent a12f093828
commit 0c0a2990a8
8 changed files with 102 additions and 10 deletions

View 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);
}
}