@@ -26,7 +26,7 @@ import {
26
26
Component ,
27
27
EventEmitter , Input , OnChanges , OnInit , Output , SimpleChanges
28
28
} from '@angular/core' ;
29
- import { JsonFormsRendererRegistryEntry , JsonSchema , UISchemaElement , UISchemaTester , ValidationMode } from '@jsonforms/core' ;
29
+ import { Actions , JsonFormsRendererRegistryEntry , JsonSchema , UISchemaElement , UISchemaTester , ValidationMode } from '@jsonforms/core' ;
30
30
import { Ajv } from 'ajv' ;
31
31
import { JsonFormsAngularService , USE_STATE_VALUE } from './jsonforms.service' ;
32
32
@Component ( {
@@ -46,6 +46,7 @@ export class JsonForms implements OnChanges, OnInit {
46
46
@Input ( ) readonly : boolean ;
47
47
@Input ( ) validationMode : ValidationMode ;
48
48
@Input ( ) ajv : Ajv ;
49
+ @Input ( ) config : any ;
49
50
50
51
private initialized = false ;
51
52
@@ -63,7 +64,9 @@ export class JsonForms implements OnChanges, OnInit {
63
64
} ,
64
65
uischemas : this . uischemas ,
65
66
i18n : { locale : this . locale , localizedSchemas : undefined , localizedUISchemas : undefined } ,
66
- renderers : this . renderers
67
+ renderers : this . renderers ,
68
+ config : this . config ,
69
+ readonly : this . readonly
67
70
} ) ;
68
71
this . jsonformsService . $state . subscribe ( state => {
69
72
const data = state ?. jsonforms ?. core ?. data ;
@@ -88,6 +91,7 @@ export class JsonForms implements OnChanges, OnInit {
88
91
const newReadonly = changes . readonly ;
89
92
const newValidationMode = changes . validationMode ;
90
93
const newAjv = changes . ajv ;
94
+ const newConfig = changes . config ;
91
95
92
96
if ( newData || newSchema || newUiSchema || newValidationMode || newAjv ) {
93
97
this . jsonformsService . updateCoreState (
@@ -114,5 +118,9 @@ export class JsonForms implements OnChanges, OnInit {
114
118
if ( newReadonly && ! newReadonly . isFirstChange ( ) ) {
115
119
this . jsonformsService . setReadonly ( newReadonly . currentValue ) ;
116
120
}
121
+
122
+ if ( newConfig && ! newConfig . isFirstChange ( ) ) {
123
+ this . jsonformsService . updateConfig ( Actions . setConfig ( newConfig . currentValue ) ) ;
124
+ }
117
125
}
118
126
}
0 commit comments