I just upgraded to the latest Canadian version of ember and noticed that my initializer, which introduced the currentUser controller in all controllers, no longer works.
Here is the code.
Ember.Application.initializer({
name: "fetchUsers",
after: "store",
initialize: function(container, application) {
var store, controller;
application.deferReadiness();
store = container.lookup('store:main');
controller = container.lookup('controller:currentUser');
return store.find('user').then( function(users) {
var currentUser;
currentUser = users.findBy('isCurrent', true);
controller.set('content', currentUser);
application.inject('controller', 'currentUser', 'controller:currentUser');
application.advanceReadiness();
});
}
});
This works great in release and beta branches, but for canary I get the following error.
Error: Cannot inject a `controller:current-user` on other controller(s). Register the `controller:current-user` as a different type and perform the typeInjection.
How can I fix this? I would like currentUser to be an ObjectController, is this possible?
source
share