renovations

This commit is contained in:
Ilya Kantor 2015-02-19 23:57:02 +03:00
parent e706693c7e
commit 24171550ae
23 changed files with 196 additions and 76 deletions

View file

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.2.0/lodash.js"></script>
<script type="text/template" id="menu-template">
<div class="menu">
<span class="title"><%-title%>
<ul>
<% items.forEach(function(item) { %>
<li><%-item%></li>
<% }); %>
</ul>
</div>
</script>
<script>
var tmpl = document.getElementById('menu-template').innerHTML;
var compiled = _.template(tmpl, null, {sourceURL: '/template/menu-template'});
var result = compiled({ title: "Заголовок" });
document.write(result);
</script>
</body>
</html>