I am building a project management app using ember.js-pre3 ember-data revision 11.
How do I initialize a couple of controllers and make them available globally. For example I have a currentUser controller and usersController that I need access to in every state. I used to have the following code in the Ember.ready function but It no longer works. I guess the way I was doing it was intended for debugging. https://github.com/emberjs/ember.js/issues/1646
Old Way:
window.Fp = Ember.Application.create
ready: () ->
# Initialize Global collections
appController = @get 'router.applicationController'
store = @get 'router.store'
# User controller sets usersController binding on applicationController
# fetches all team users from server
# json returned from server includes flag "isCurrent"
usersController = @get 'router.usersController'
usersController.set 'content', store.findAll(Fp.User)
appController.set 'usersController', usersController
# CurrentUserController
# sets currentUserController binding on applicationController
# finds currentUser from usersController
currentUserController = @get 'router.currentUserController'
currentUserController.set 'content', usersController.get('findCurrentUser')
appController.set 'currentUserController', currentUserController
@_super()
What is the proper way to have access to the currentUser controller in all application states.