Bill change should be working
Reduce quantity should be working.
This commit is contained in:
@ -2,6 +2,8 @@ import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
import { MathService } from '../../shared/math.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-quantity',
|
||||
templateUrl: './quantity.component.html',
|
||||
@ -14,6 +16,7 @@ export class QuantityComponent implements OnInit {
|
||||
public dialogRef: MatDialogRef<QuantityComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: number,
|
||||
private fb: FormBuilder,
|
||||
private math: MathService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
@ -31,7 +34,7 @@ export class QuantityComponent implements OnInit {
|
||||
}
|
||||
|
||||
accept(): void {
|
||||
const { quantity } = this.form.value;
|
||||
const quantity = this.math.parseAmount(this.form.value.quantity);
|
||||
this.dialogRef.close(quantity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user