Ember Inject Controller
The Problem I Encountered:
After updating my Ember project to version 1.13.5, I received the following warning in the browser console:
However, I couldn't find any documentation on how to implement the new syntax.
The Solution:
Though it's marked as a private method in the Ember documentation, you can view it by selecting the "private" checkbox.
There are two ways to use Ember.inject.controller()
: with and without specifying a controller name.
When you don't specify the name of the controller, Ember uses the property name to look it up, as in:
posts: Ember.inject.controller('posts').
You will only need to specify the controller name if the property name and the controller name are different.
This way, you can successfully update your project to comply with the new Ember guidelines.