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, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dial
|
||||
})
|
||||
export class AccountDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
accountTypes: AccountType[] = [];
|
||||
costCentres: CostCentre[] = [];
|
||||
item: Account = new Account();
|
||||
@@ -26,7 +26,7 @@ export class AccountDetailComponent implements OnInit, AfterViewInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: AccountService,
|
||||
) {
|
||||
|
||||
@@ -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 { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
@@ -21,18 +21,18 @@ export class AccountListComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: AccountListDataSource;
|
||||
filter: Observable<string>;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
list: Account[] = [];
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'type', 'isActive', 'isReconcilable', 'costCentre'];
|
||||
|
||||
constructor(private route: ActivatedRoute, private fb: FormBuilder) {
|
||||
constructor(private route: ActivatedRoute, private fb: UntypedFormBuilder) {
|
||||
this.form = this.fb.group({
|
||||
filter: '',
|
||||
});
|
||||
// Listen to Filter Change
|
||||
this.filter = (this.form.get('filter') as FormControl).valueChanges.pipe(
|
||||
this.filter = (this.form.get('filter') as UntypedFormControl).valueChanges.pipe(
|
||||
startWith(''),
|
||||
debounceTime(150),
|
||||
distinctUntilChanged(),
|
||||
|
||||
Reference in New Issue
Block a user