Skip to content

Instantly share code, notes, and snippets.

@jrhe
Created September 17, 2013 21:18
Show Gist options
  • Save jrhe/6600784 to your computer and use it in GitHub Desktop.
Save jrhe/6600784 to your computer and use it in GitHub Desktop.
Ember Inject problem. Inject was injecting currentUser to all controllers except application and index. Passing the promise directly to inject solved this.
var user = store.find('user', 'current');
container.lookup('controller:currentUser').set('content', user);
App.inject('controller', 'currentUser', 'controller:currentUser');
var user = store.find('user', 'current').then(function(user) {
container.lookup('controller:currentUser').set('content', user);
App.inject('controller', 'currentUser', 'controller:currentUser');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment