I have a simple add event in Backbonejs, I also have template:
initialize: function()
{
this.template = _.template($("#person-template").html());
}
renderperson: function(model)
{
//model.name is "Jack" for example
//Now I want to render this template with Name replaced with "Jack"?
$("#somelement").append( ); //What to do here???
}
template is simple:
<script type="text/template" id="person-template">
<div class="person"><%= Name %></div>
</script>
you may also need to add
to your initialize method