update to angular 14

This commit is contained in:
Dan Percic 2022-06-14 19:08:13 +03:00
parent 43a9067bf3
commit 9ee7b12e4a
3 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
import { Directive, HostListener, Injector, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { AutoUnsubscribe, hasFormChanged, IqserEventTarget } from '../utils';
import { ConfirmOptions } from '../misc';
import { ConfirmationDialogService } from './confirmation-dialog.service';
@ -25,7 +25,7 @@ export interface SaveOptions {
* (otherwise the save request will be triggered twice).
* */
export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnInit {
form!: FormGroup;
form!: UntypedFormGroup;
initialFormValue!: Record<string, string>;
private readonly _confirmationDialogService: ConfirmationDialogService = this._injector.get(ConfirmationDialogService);
private readonly _dialog: MatDialog = this._injector.get(MatDialog);

View File

@ -1,10 +1,10 @@
import { Directive } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { AutoUnsubscribe, hasFormChanged } from '../utils';
@Directive()
export abstract class BaseFormComponent extends AutoUnsubscribe {
form!: FormGroup;
form!: UntypedFormGroup;
initialFormValue!: Record<string, string>;
get changed(): boolean {

View File

@ -1,5 +1,5 @@
import { ITrackable } from '../listing/models/trackable';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { forOwn, has, isEqual, isPlainObject, transform } from 'lodash-es';
import dayjs, { Dayjs } from 'dayjs';
@ -35,7 +35,7 @@ export function trackByFactory<T extends ITrackable>() {
return (index: number, item: T): string => item.id;
}
export function hasFormChanged(form: FormGroup, initialFormValue: Record<string, string>): boolean {
export function hasFormChanged(form: UntypedFormGroup, initialFormValue: Record<string, string>): boolean {
if (form && initialFormValue) {
for (const key of Object.keys(form.getRawValue())) {
const initialValue = initialFormValue[key];