How to do dependency injection in Ember with Ember CLI?
问题 First, I made a small Ember app without Ember CLI. I had this piece of code. window.MyApp = Ember.Application.create({ ready: function() { this.register('session:current', MyApp.SessionController, { singleton: true }); this.inject('controller', 'session', 'session:current'); } }); This worked. Then I decided to rewrite everything from scratch with Ember CLI. I edited the file app/app.js and added the ready hook just like in my previous version. var App = Ember.Application.extend({