October 2016
Intermediate to advanced
452 pages
9h 5m
English
Pure.js is a JavaScript templating engine that takes the concept of logic-less templates to an even greater extreme than Mustache and Handlebars do. Pure.js uses no special template expression syntax that has to be interpolated before rendering. Instead, it uses only pure HTML tags and CSS selectors, combined with JSON data, to render values in the DOM. In this way, Pure.js uses entirely logic-less views because there is no template markup in which to include any logic.
Using plain HTML, a simple Pure.js template can be constructed like this:
<p class="my-template">
Hello, my name is <span></span>.
</p>
The empty <span> element is where you might add data for a particular template, but you can use any HTML tag.
var data = { name: 'Udis ...Read now
Unlock full access