UNPKG

@web-atoms/core

Version:
47 lines (46 loc) 1.26 kB
System.register(["./AtomControl"], function (_export, _context) { "use strict"; var AtomControl, AtomTemplateControl; _export("AtomTemplateControl", void 0); return { setters: [function (_AtomControl) { AtomControl = _AtomControl.AtomControl; }], execute: function () { _export("AtomTemplateControl", AtomTemplateControl = class AtomTemplateControl extends AtomControl { onPropertyChanged(name) { if (name === "contentTemplate") { this.createContent(); } } onUpdateUI() { super.onUpdateUI(); if (this.content) { return; } if (this.contentTemplate) { this.createContent(); } } preCreate() { this.contentTemplate = null; this.content = null; } createContent() { const t = this.contentTemplate; if (!t) { return; } const tc = this.content; if (tc) { tc.dispose(); this.content = null; } const ntc = this.content = new t(this.app); this.append(ntc); } }); } }; }); //# sourceMappingURL=AtomTemplateControl.js.map