Skip to content

@mahemoff /example.coffee
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Managing templates with Underscore template
templates = {}
$ () ->
$('.template').each (i,el) -> templates[el.id.replace('Template','')] = _.template(el.innerHTML)
....
# LATER ON, HERE IS HOW WE USE THE TEMPLATE ...
....
$('.storyContainer').html templates.story
title: 'holy crazy!'
content: 'an amazing story'
<script id='storyTemplate' class='template' type='text/template'>
<h1><%= title %></h1>
<p><%= content %></p>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.