Chore: Upgrade to Angular v14

This commit is contained in:
2022-07-11 20:12:38 +05:30
parent a4c3ae1035
commit b1c003a935
54 changed files with 355 additions and 325 deletions
@@ -1,5 +1,5 @@
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import * as moment from 'moment';
@@ -17,7 +17,7 @@ import { EmployeeService } from '../employee.service';
})
export class EmployeeDetailComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
form: FormGroup;
form: UntypedFormGroup;
costCentres: CostCentre[] = [];
item: Employee = new Employee();
@@ -25,7 +25,7 @@ export class EmployeeDetailComponent implements OnInit, AfterViewInit {
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog,
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private toaster: ToasterService,
private ser: EmployeeService,
) {
@@ -41,7 +41,7 @@ export class EmployeeDetailComponent implements OnInit, AfterViewInit {
leavingDate: '',
});
// Listen to IsActive Changes
(this.form.get('isActive') as FormControl).valueChanges.subscribe((x) => {
(this.form.get('isActive') as UntypedFormControl).valueChanges.subscribe((x) => {
this.item.isActive = x;
});
}