diff --git a/src/demo/app/editor.ts b/src/demo/app/editor.ts index 93717eb..2763622 100644 --- a/src/demo/app/editor.ts +++ b/src/demo/app/editor.ts @@ -49,18 +49,9 @@ export class Editor implements Flo.Editor { let bsModalRef = this.modelService.show(PropertiesDialogComponent); let metadata : Flo.ElementMetadata = cell.attr('metadata'); bsModalRef.content.title = `Properties for ${metadata.name.toUpperCase()}`; - // metadata.properties().then((allProps : Array) => { - // let models = allProps.map(p => new Flo.PropertiesForm.GenericControlModel({ - // id: p.id, - // name: p.name, - // defaultValue: p.defaultValue, - // attr: `props/${p.name}`, - // value: cell.attr(`props/${p.name}`), - // description: p.description - // }, Flo.PropertiesForm.InputType.TEXT)); - // bsModalRef.content.addControlModels(models); - // }); - bsModalRef.content.propertiesGroupModel = new SamplePropertiesGroupModel(cell); + let propertiesModel = new SamplePropertiesGroupModel(cell); + propertiesModel.load(); + bsModalRef.content.propertiesGroupModel = propertiesModel; } validatePort(context : Flo.EditorContext, view : dia.ElementView, magnet : SVGElement) { diff --git a/src/lib/src/shared/flo.properties.ts b/src/lib/src/shared/flo.properties.ts index f21b68a..47ea355 100644 --- a/src/lib/src/shared/flo.properties.ts +++ b/src/lib/src/shared/flo.properties.ts @@ -106,10 +106,11 @@ export namespace Properties { constructor(cell : dia.Cell) { this.cell = cell; - this.init(); } - private init() { + load() { + this.loading = true; + this._loadedSubject.next(false); this.createProperties().then(properties => { this.controlModels = properties.map(p => this.createControlModel(p)); this.loading = false;