Chore: Upgrade to Angular v14
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormArray, UntypedFormBuilder, FormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
@@ -29,7 +29,7 @@ export class ClosingStockComponent implements OnInit {
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
info: ClosingStock = new ClosingStock();
|
||||
dataSource: ClosingStockDataSource = new ClosingStockDataSource(this.info.items);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = [
|
||||
'product',
|
||||
@@ -46,7 +46,7 @@ export class ClosingStockComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
private dialog: MatDialog,
|
||||
private toaster: ToasterService,
|
||||
@@ -108,7 +108,7 @@ export class ClosingStockComponent implements OnInit {
|
||||
getClosingStock(): ClosingStock {
|
||||
const formModel = this.form.value;
|
||||
this.info.date = moment(formModel.date).format('DD-MMM-YYYY');
|
||||
const array = this.form.get('stocks') as FormArray;
|
||||
const array = this.form.get('stocks') as UntypedFormArray;
|
||||
this.info.items.forEach((item, index) => {
|
||||
item.physical = +array.controls[index].value.physical;
|
||||
item.costCentre =
|
||||
|
||||
Reference in New Issue
Block a user