sodajs
Version:
Light weight but powerful template engine for JavaScript.
33 lines (27 loc) • 588 B
HTML
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script src="../dist/soda.min.js"></script>
<script>
soda.prefix('o-')
var tpl = '\
<ul>\
<li o-repeat="item in list" o-if="item.show">\
{{item.name}}\
</li>\
</ul>'
var data = {
list: [
{name: "Hello" ,show: true},
{name: "sodajs" ,show: true},
{name: "AlloyTeam"}
]
};
document.body.innerHTML = soda(tpl, data);
</script>
</body>
</html>