Difference between revisions of "Dust.js"
Karl Jones (Talk | contribs) (→External links) |
Karl Jones (Talk | contribs) (→External links) |
||
Line 28: | Line 28: | ||
* [http://www.slideshare.net/brikis98/dustjs dust.js @ LinkedIn] | * [http://www.slideshare.net/brikis98/dustjs dust.js @ LinkedIn] | ||
* [http://ncona.com/2013/05/why-and-how-is-dust-js-asynchronous/ Why and how is dust.js asynchronous] | * [http://ncona.com/2013/05/why-and-how-is-dust-js-asynchronous/ Why and how is dust.js asynchronous] | ||
+ | * [http://hackersome.com/p/ericktai/dust-js-browser dust-js-browser] | ||
[[Category:JavaScript]] | [[Category:JavaScript]] | ||
[[Category:JavaScript libraries]] | [[Category:JavaScript libraries]] |
Latest revision as of 07:48, 31 October 2016
Dust.js is a JavaScript templating engine designed to provide a clean separation between presentation and logic without sacrificing ease of use. It is particularly well-suited for asynchronous and streaming applications.
Description
A pure JavaScript library, Dust is runs in both browser-side and server-side environments.
Dust templates are compiled and then loaded where they are needed along with the runtime library. The library doesn't make any assumptions about how templates are loaded; you are free to integrate templating into your environment as you see fit.
Syntax
Dust templates use two types of tags: keys and sections.
Keys reference fields within the current view context. You can think of them as placeholders that allow the context to insert data into the template. Sections accept template blocks that may be enumerated, filtered or transformed in various ways.
Keys
To reference a key from the view context within the template, enclose the key in curly braces.