Chore: Upgrade to Angular v14
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user