Created
November 6, 2013 20:02
-
-
Save daneharrigan/7343158 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var scripts = Ember.$("script[type='text/x-handlebars'][src]") | |
scripts.each(function(_, script){ | |
Ember.$.ajax({ | |
async: false, | |
url: script.src, | |
dataType: "html" | |
}).done(function(html){ | |
var name = script.getAttribute("data-template-name") || "application"; | |
Ember.TEMPLATES[name] = Ember.Handlebars.compile(html); | |
script.parentNode.removeChild(script); | |
}) | |
}); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<!-- templates --> | |
<script type="text/x-handlebars" src="/libs/hbs/application.hbs"></script> | |
<script type="text/x-handlebars" src="/libs/hbs/foo.hbs" data-template-name="foo"></script> | |
<!-- deps --> | |
<script src="/assets/js/libs/jquery-1.9.1.js"></script> | |
<script src="/assets/js/libs/handlebars-1.0.0.js"></script> | |
<script src="/assets/js/libs/ember-1.1.2.js"></script> | |
<script src="/assets/js/libs/ember-autoload.js"></script> <!-- template loader --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment