Is there any other way to deal with Ember.Router controllers and views? My application structure usually depends on require.js, which takes care of the respective dependencies.
In my example, I am making the App.ApplicationController application the primary controller of the router.
Here's jsfiddle: http://jsfiddle.net/mediastuttgart/uMKGt/1/
But is there a chance to set this manually? I found this commit message https://github.com/emberjs/ember.js/commit/be69395f5eec4187b1df052d7386bcda45f79475 , where I can see how to configure the controller and view it manually (anyway,). But the following example could not be found:
App = Ember.Application.create();
App.MyController = Ember.Controller.extend({});
App.MyView = Ember.View.extend({});
Router = Ember.Router.extend({
applicationController : App.MyController,
root : Ember.Route.extend({
index : Ember.Route.extend({
route : '/',
connectOutlets : function (router) {
router.get('applicationController').connectOutlet(App.MyView);
}
})
}),
...
});
EDIT
. require.js , , . , . , ,
- app
-- controller
-- view
-- model
-- router
-- template
Em.Provide('App.Controller.Newsletter');, App.Controller.Newsletter. . App.Controller.Newsletter.Signup = Ember.Controller.extend({});, "ApplicationController" . , App.ApplicationController Ember.Router.