use relative import in common-ui
This commit is contained in:
parent
7c9c00eae9
commit
b65ad23aaa
@ -1,17 +1,12 @@
|
|||||||
import { Directive } from '@angular/core';
|
import { Directive } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { AutoUnsubscribe, hasFormChanged } from '@iqser/common-ui';
|
import { AutoUnsubscribe, hasFormChanged } from '../utils';
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export abstract class BaseFormComponent extends AutoUnsubscribe {
|
export abstract class BaseFormComponent extends AutoUnsubscribe {
|
||||||
|
|
||||||
form!: FormGroup;
|
form!: FormGroup;
|
||||||
initialFormValue;
|
initialFormValue;
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
get changed(): boolean {
|
get changed(): boolean {
|
||||||
return hasFormChanged(this.form, this.initialFormValue);
|
return hasFormChanged(this.form, this.initialFormValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,6 @@ export function trackByFactory<T extends ITrackable>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function hasFormChanged(form: FormGroup, initialFormValue): boolean {
|
export function hasFormChanged(form: FormGroup, initialFormValue): boolean {
|
||||||
|
|
||||||
if (form && initialFormValue) {
|
if (form && initialFormValue) {
|
||||||
for (const key of Object.keys(form.getRawValue())) {
|
for (const key of Object.keys(form.getRawValue())) {
|
||||||
const initialValue = initialFormValue[key];
|
const initialValue = initialFormValue[key];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user