Reputation: 3897
So I've seen handlebars templates do this:
<script id="some-template" type="text/x-handlebars-template"> </script>
and am wondering if there's a way to use underscore.js templates like this. It would be really nice to have my templates in markup instead of sitting inside a string.
Upvotes: 0
Views: 126
Reputation: 6947
Sure, you can do this easily.
var templateText= document.getElementById('some-template').innerHTML;
Upvotes: 2