diff --git a/lib/components/JsonSchema/json-schema-lazy.js b/lib/components/JsonSchema/json-schema-lazy.js index 8992cda9..47a98624 100644 --- a/lib/components/JsonSchema/json-schema-lazy.js +++ b/lib/components/JsonSchema/json-schema-lazy.js @@ -14,7 +14,7 @@ var cache = {}; @Component({ selector: 'json-schema-lazy', - inputs: ['pointer', 'auto'], + inputs: ['pointer', 'auto', 'skipReadOnly'], template: '', directives: [CORE_DIRECTIVES] }) @@ -38,7 +38,7 @@ export default class JsonSchemaLazy { if (this.loaded) return; if (this.pointer) { this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => { - compRef.instance.pointer = this.pointer; + this.initComponent(compRef); // trigger change detection compRef.hostView.changeDetectorRef.detectChanges(); }); @@ -58,7 +58,7 @@ export default class JsonSchemaLazy { // FIXME: get rid of dependency on selector if ($element.querySelector('.discriminator-wrap')) { this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => { - compRef.instance.pointer = this.pointer; + this.initComponent(compRef); compRef.hostView.changeDetectorRef.markForCheck(); }); return; @@ -68,13 +68,18 @@ export default class JsonSchemaLazy { }); } else { cache[this.pointer] = this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => { - compRef.instance.pointer = this.pointer; + this.initComponent(compRef); compRef.hostView.changeDetectorRef.markForCheck(); return compRef; }); } } + initComponent(compRef) { + compRef.instance.pointer = this.pointer; + compRef.instance.skipReadOnly = this.skipReadOnly; + } + ngAfterViewInit() { if (!this.auto) return; this.loadCached(); diff --git a/lib/components/JsonSchema/json-schema.html b/lib/components/JsonSchema/json-schema.html index bc3fcca8..f633f901 100644 --- a/lib/components/JsonSchema/json-schema.html +++ b/lib/components/JsonSchema/json-schema.html @@ -38,8 +38,8 @@