Message from JavaScript discussions

November 2017

— Like adding event listener?

— 

You can add them easily by using success

loader.loadTemplate("#myTemplate", "#myContainer", {
data: dataSource,
success: insertedNode => insertedNode.addEventListener("click", myFunc)
});

— There are formatters that can mutate tag strings

— All this does is inject data into a predefined template and insert it into a destination node

— TagStrings, yes

— You can set a namespaceURI though and query it

— But the 2 main uses are either pulling templates from script or template tags, or getting the tagString via XHR

Message permanent page

— I should probably add a method that accepts a tagString directly too, but that breaks my personal rules

Message permanent page

— IMO having html anywhere in a js document is a big no no, it's an old principle called Unobtrusive JS

Message permanent page

— I tend to lean towards the old ways like that because they are not convoluted like today's standards and frameworks

Message permanent page

— Yes, that's the core principle behind it

— So the template engine works as quickly as possible to convert a tagString to real nodes, then works on those

Message permanent page