Created
July 9, 2014 22:47
-
-
Save tylerjohnst/a6ff9f67b2f960785a1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ember.Application.initializer({ | |
| name: 'currentUser', | |
| initialize: function(container, application) { | |
| var user = App.User.create({}); | |
| container.optionsForType('user', { instantiate: false, singleton: true }); | |
| container.register('type:user', 'current', user); | |
| } | |
| }); | |
| Ember.Application.initializer({ | |
| name: 'injectCurrentUser', | |
| before: 'currentUser', | |
| initialize: function(container, application) { | |
| container.injection('controller:application', 'currentUser', 'user:current'); | |
| container.typeInjection('route', 'currentUser', 'user:current'); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment