Message from JavaScript discussions

November 2017

— It's actually a port of jQuery-template

— 

DialogBox.prototype.render = function () {
if (this.node === null) {
ct.loadTemplate("#dialogTemplate", "#dialogContainer", {
append: true,
data: this.data,
removeAttrs: false,
thisArg: this,
success: this.onRenderSuccess
});
} else {
ct.loadTemplate(this.node, "#dialogContainer", {
data: this.data,
removeAttrs: false,
thisArg: this,
success: this.onRenderSuccess
});
}
};

— I used it to make a dialog box library, well the start of one

— The else is where the box is already loaded, but the data changed, so it is patching itself

— Because you can load templates from live dom nodes, I just had it load itself as a template and replace itself

Message permanent page

— removeAttrs: false is there so the attributes stay, allowing that patch to work

— So really... it is far superior to mustache in terms of functionality

— You can just continually patch the same nodes without worrying about the template syntax going away

— Yes, too many haha

— I like combining Flux with template engines

— Flux was for React components, but one can easily replace the component with their own that just uses a template engine under the hood

Message permanent page

— Flux is like MVVM