diff --git a/lib/components/JsonSchema/json-schema-lazy.js b/lib/components/JsonSchema/json-schema-lazy.js new file mode 100644 index 00000000..992b8d91 --- /dev/null +++ b/lib/components/JsonSchema/json-schema-lazy.js @@ -0,0 +1,29 @@ +'use strict'; + +import {Component, View, EventEmitter, ElementRef} from 'angular2/core'; +import {CORE_DIRECTIVES} from 'angular2/common'; +import JsonSchema from './json-schema'; +import {DynamicComponentLoader} from 'angular2/src/core/linker/dynamic_component_loader'; + +@Component({ + selector: 'json-schema-lazy', + inputs: ['pointer'] +}) +@View({ + template: '', + directives: [CORE_DIRECTIVES] +}) +export default class JsonSchemaLazy { + + constructor(elementRef, dcl) { + this.elementRef = elementRef; + this.dcl = dcl; + } + + load() { + this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => { + compRef.instance.pointer = this.pointer; + }); + } +} +JsonSchemaLazy.parameters = [[ElementRef], [DynamicComponentLoader]]; diff --git a/lib/components/ResponsesList/responses-list.html b/lib/components/ResponsesList/responses-list.html index aa9df574..f6ea37d9 100644 --- a/lib/components/ResponsesList/responses-list.html +++ b/lib/components/ResponsesList/responses-list.html @@ -1,6 +1,6 @@