Save Bill Works

This commit is contained in:
Amritanshu
2019-07-13 21:32:18 +05:30
parent bcad4cdae3
commit 7d06a2f961
43 changed files with 660 additions and 349 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-quantity',
templateUrl: './quantity.component.html',
styleUrls: ['./quantity.component.css']
})
export class QuantityComponent implements OnInit {
form: FormGroup;
constructor(
public dialogRef: MatDialogRef<QuantityComponent>,
@Inject(MAT_DIALOG_DATA) public data: number,
private fb: FormBuilder,
) {
this.createForm();
}
ngOnInit() {
this.form.setValue({
quantity: this.data
});
}
createForm() {
this.form = this.fb.group({
quantity: ''
});
}
accept(): void {
const quantity = this.form.value.quantity;
this.dialogRef.close(quantity);
}
}