public/javascripts/vendor/javascripts/ember.js
function(router) {
    var properties = Ember.A(Ember.keys(this)),
        injections = get(this.constructor, 'injections'),
        namespace = this, controller, name;

    if (!router && Ember.Router.detect(namespace['Router'])) {
      router = namespace['Router'].create();
      this._createdRouter = router;
    }

    if (router) {
      set(this, 'router', router);

      // By default, the router's namespace is the current application.
      //
      // This allows it to find model classes when a state has a
      // route like `/posts/:post_id`. In that case, it would first
      // convert `post_id` into `Post`, and then look it up on its
      // namespace.
      set(router, 'namespace', this);
    }

    Ember.runLoadHooks('application', this);

    injections.forEach(function(injection) {
      properties.forEach(function(property) {
        injection[1](namespace, router, property);
      });
    });

    if (router && router instanceof Ember.Router) {
      this.startRouting(router);
    }
  }
function(router) {
    var properties = Ember.A(Ember.keys(this)),
        injections = get(this.constructor, 'injections'),
        namespace = this, controller, name;

    if (!router && Ember.Router.detect(namespace['Router'])) {
      router = namespace['Router'].create();
      this._createdRouter = router;
    }

    if (router) {
      set(this, 'router', router);

      // By default, the router's namespace is the current application.
      //
      // This allows it to find model classes when a state has a
      // route like `/posts/:post_id`. In that case, it would first
      // convert `post_id` into `Post`, and then look it up on its
      // namespace.
      set(router, 'namespace', this);
    }

    Ember.runLoadHooks('application', this);

    injections.forEach(function(injection) {
      properties.forEach(function(property) {
        injection[1](namespace, router, property);
      });
    });

    if (router && router instanceof Ember.Router) {
      this.startRouting(router);
    }
  }
function ( router ) { var properties = Ember . A ( Ember . keys ( this ) ) , injections = get ( this . constructor , 'injections' ) , namespace = this , controller , name ; if ( ! router && Ember . Router . detect ( namespace [ 'Router' ] ) ) { router = namespace [ 'Router' ] . create ( ) ; this . _createdRouter = router ; } if ( router ) { set ( this , 'router' , router ) ; // By default, the router's namespace is the current application. // // This allows it to find model classes when a state has a // route like `/posts/:post_id`. In that case, it would first // convert `post_id` into `Post`, and then look it up on its // namespace. set ( router , 'namespace' , this ) ; } Ember . runLoadHooks ( 'application' , this ) ; injections . forEach ( function ( injection ) { properties . forEach ( function ( property ) { injection [ 1 ] ( namespace , router , property ) ; } ) ; } ) ; if ( router && router instanceof Ember . Router ) { this . startRouting ( router ) ; } }
Instantiate all controllers currently available on the namespace
and inject them onto a router.

Example:

App.PostsController = Ember.ArrayController.extend();
App.CommentsController = Ember.ArrayController.extend();

var router = Ember.Router.create({
...
});

App.initialize(router);

router.get('postsController')     // <App.PostsController:ember1234>
router.get('commentsController')  // <App.CommentsController:ember1235>

router.get('postsController.router') // router
Instantiate all controllers currently available on the namespace and inject them onto a router .