emberjs/ember.js — pull request #2215 by guilhermeaiolfi (2013-03-05 02:43:58+00:00)
Title: Added a "loader" method in Ember.Router to be used to load files async

Proposed fix for #2194

Use:

```javascript
App.Router.reopen({
loader: function(handler, done){
var modules = moduleName(handler.handler); //or a JSON map, or another method, up to developer to decide
require(modules, function(module) {
done();
});
}
});
```

By default, it will call done() directly. So it is backwards compatible.