Skip to content

0.2.0 theory singles

Ivan S Glazunov edited this page Feb 20, 2015 · 2 revisions

theory about singles

Ready-to-use double tags. Full documentation.

Available double tags

br hr img input base frame link meta style

Getting from the collection Templates.singles:
var img = Templates.singles.img, br = Templates.singles.br;
Independent use involves the complete syntax:
img(/* string selectors and object attributes */)
Example:
img('.radius[src=image.png]')
.render(function(result) {
	console.log(result);
});
<img class="radius" src="image.png"/>
In the content of another element, tags can be used in short:
div('.container')(
	img, // short
	img('.radius[src=image.png]') // full
).render(console.log);
<div class="container">
	<img/>
	<img class="radius" src="image.png"/>
</div>
Clone this wiki locally