Created
March 21, 2013 15:41
-
-
Save rintaun/5214023 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
| define([ | |
| 'ember', | |
| 'template!templates/application.hbs' | |
| ], function(Ember) { | |
| var MyApp = Ember.Application.create(); | |
| return MyApp; | |
| }); |
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
| 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