Skip to content

Commit

Permalink
fix(json-schema): detect change of multischema (#2858)
Browse files Browse the repository at this point in the history
fix #2815
  • Loading branch information
aitboudad committed May 23, 2021
1 parent 84f47e5 commit 2296330
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/json-schema/src/formly-json-schema.service.ts
Expand Up @@ -7,6 +7,7 @@ import {
ɵgetFieldInitialValue as getFieldInitialValue,
ɵclone as clone,
} from '@ngx-formly/core';
import { tap } from 'rxjs/operators';

export interface FormlyJsonschemaOptions {
/**
Expand Down Expand Up @@ -365,6 +366,11 @@ export class FormlyJsonschema {
options: schemas
.map((s, i) => ({ label: s.title, value: i, disabled: s.readOnly })),
},
hooks: {
onInit: f => f.formControl.valueChanges.pipe(
tap(() => (f.options as any)._checkField(f.parent)),
),
},
},
{
fieldGroup: schemas.map((s, i) => ({
Expand Down

0 comments on commit 2296330

Please sign in to comment.