From eba92399e34eff696b27c65659b64f04a00c530a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 14 Jun 2019 22:45:13 +0200 Subject: [PATCH] update TemplateView with changes --- src/ui/web/TemplateView.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/web/TemplateView.js b/src/ui/web/TemplateView.js index f0a16cf0..96d1a500 100644 --- a/src/ui/web/TemplateView.js +++ b/src/ui/web/TemplateView.js @@ -2,7 +2,8 @@ import Template from "./Template.js"; export default class TemplateView { constructor(value) { - this._template = new Template(value, (t, value) => this.render(t, value)); + this.viewModel = value; + this._template = null; } render() { @@ -10,9 +11,8 @@ export default class TemplateView { } mount() { - const root = this._template.root(); - this._template.attach(); - return root; + this._template = new Template(this.viewModel, (t, value) => this.render(t, value)); + return this.root(); } root() { @@ -20,7 +20,8 @@ export default class TemplateView { } unmount() { - this._template.detach(); + this._template.dispose(); + this._template = null; } update(value) {