Chore:
Upgraded to Angular 14
This commit is contained in:
@ -1,5 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import { map } from 'rxjs/operators';
|
||||
@ -20,7 +25,7 @@ import { UpdateProductPricesService } from './update-product-prices.service';
|
||||
export class UpdateProductPricesComponent implements OnInit {
|
||||
info: UpdateProductPrices = new UpdateProductPrices();
|
||||
dataSource: UpdateProductPricesDataSource = new UpdateProductPricesDataSource(this.info.items);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
menuCategories: MenuCategory[] = [];
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
@ -29,7 +34,7 @@ export class UpdateProductPricesComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
private toaster: ToasterService,
|
||||
private ser: UpdateProductPricesService,
|
||||
@ -95,7 +100,7 @@ export class UpdateProductPricesComponent implements OnInit {
|
||||
|
||||
getInfo(): UpdateProductPrices {
|
||||
const formModel = this.form.value;
|
||||
const array = this.form.get('prices') as FormArray;
|
||||
const array = this.form.get('prices') as UntypedFormArray;
|
||||
this.info.items.forEach((item, index) => {
|
||||
item.newPrice = array.controls[index].value.newPrice;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user