Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
@@ -27,7 +27,13 @@ export class PurchaseDialogComponent implements OnInit {
|
||||
private math: MathService,
|
||||
private productSer: ProductService,
|
||||
) {
|
||||
this.createForm();
|
||||
this.form = this.fb.group({
|
||||
product: '',
|
||||
quantity: '',
|
||||
price: '',
|
||||
tax: '',
|
||||
discount: '',
|
||||
});
|
||||
this.listenToProductAutocompleteChange();
|
||||
}
|
||||
|
||||
@@ -42,16 +48,6 @@ export class PurchaseDialogComponent implements OnInit {
|
||||
this.product = this.data.inventory.product;
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
product: '',
|
||||
quantity: '',
|
||||
price: '',
|
||||
tax: '',
|
||||
discount: '',
|
||||
});
|
||||
}
|
||||
|
||||
listenToProductAutocompleteChange(): void {
|
||||
const control = this.form.get('product');
|
||||
this.products = control.valueChanges.pipe(
|
||||
|
||||
Reference in New Issue
Block a user