Work inside OnPush components

pull/9223/head
Aleix Suau 4 years ago
parent b91e9d4201
commit dd781a1457
  1. 4
      frontend/src/app/modules/common/dynamic-forms/components/dynamic-form/dynamic-form.component.ts

@ -7,6 +7,7 @@ import {
EventEmitter,
forwardRef,
SimpleChanges,
ChangeDetectorRef,
} from "@angular/core";
import { FormlyForm } from "@ngx-formly/core";
import { DynamicFormService } from "../../services/dynamic-form/dynamic-form.service";
@ -158,6 +159,7 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements Control
private _pathHelperService:PathHelperService,
private _notificationsService:NotificationsService,
private _formsService: FormsService,
private _changeDetectorRef: ChangeDetectorRef,
) {
super();
}
@ -305,6 +307,8 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements Control
this.fields = this.fieldsSettingsPipe ? this.fieldsSettingsPipe(fields) : fields;
this.innerModel = model;
this._changeDetectorRef.detectChanges();
if (!this.isStandaloneForm) {
this.onChange(this.innerModel);
}

Loading…
Cancel
Save