Blacked and isorted the python files
Prettied and eslinted the typescript/html files
This commit is contained in:
@ -1,11 +1,24 @@
|
||||
<mat-dialog-content>
|
||||
<form [formGroup]="form">
|
||||
<div fxLayout="row" fxLayoutAlign="space-around start" fxLayout.lt-md="column" fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Quantity</mat-label>
|
||||
<input type="text" matInput #quantity placeholder="Quantity" formControlName="quantity" autocomplete="off"
|
||||
(focus)="quantity.select()" cdkFocusInitial>
|
||||
<input
|
||||
type="text"
|
||||
matInput
|
||||
#quantity
|
||||
placeholder="Quantity"
|
||||
formControlName="quantity"
|
||||
autocomplete="off"
|
||||
(focus)="quantity.select()"
|
||||
cdkFocusInitial
|
||||
/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -8,9 +8,8 @@ describe('QuantityComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ QuantityComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [QuantityComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'app-quantity',
|
||||
templateUrl: './quantity.component.html',
|
||||
styleUrls: ['./quantity.component.css']
|
||||
styleUrls: ['./quantity.component.css'],
|
||||
})
|
||||
export class QuantityComponent implements OnInit {
|
||||
form: FormGroup;
|
||||
@ -20,18 +20,18 @@ export class QuantityComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.form.setValue({
|
||||
quantity: this.data
|
||||
quantity: this.data,
|
||||
});
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
quantity: ''
|
||||
quantity: '',
|
||||
});
|
||||
}
|
||||
|
||||
accept(): void {
|
||||
const quantity = this.form.value.quantity;
|
||||
const { quantity } = this.form.value;
|
||||
this.dialogRef.close(quantity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user