Skip to content

Instantly share code, notes, and snippets.

@rintaun
Created March 21, 2013 15:41
Show Gist options
  • Save rintaun/5214023 to your computer and use it in GitHub Desktop.
Save rintaun/5214023 to your computer and use it in GitHub Desktop.
define([
'ember',
'template!templates/application.hbs'
], function(Ember) {
var MyApp = Ember.Application.create();
return MyApp;
});
define(function() {
var nameFind = /\/([^\/]+)\.(js|hbs)$/;
function parse(name) {
var matched = nameFind.exec(name)[1] || name;
return matched;
}
return {
load: function(name, req, onLoad, config) {
parsedName = parse(name);
req(['ember', 'text!' + name], function(E, data) {
E.TEMPLATES[parsedName] = E.Handlebars.compile(data);
onLoad(data);
return data;
});
},
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment