user1257120
user1257120

Reputation: 61

Ember.js: controllerFor x needs

I'm having a problem with controllerFor, and I found this pull request which describes deprecating controllerFor:

https://github.com/emberjs/ember.js/pull/1896

So this means that I can't use controllerFor? And if the answer is "not", why does the Ember.js docs still talk about using controllerFor, as seen here:

http://emberjs.com/guides/routing/setting-up-a-controller/

Upvotes: 6

Views: 1927

Answers (1)

CraigTeegarden
CraigTeegarden

Reputation: 8251

The pull request you linked to deprecates the controllerFor method in Ember.Controller. You can and should use controllerFor within the router, which is how it is used in the guide you referenced.

Instead of using controllerFor from controllers you are supposed to instead use the needs mechanism, which is discussed in this guide.

Upvotes: 11

Related Questions