emberjs/ember.js — pull request #1731 by klaaspieter (2013-01-08 21:16:14+00:00)
Title: Automatically synthesize the controller 'needs' dependencies

Add a little bit of hidden magic that automatically synthesizes properties for dependencies specified using `needs`. The following:

App.PostController = Em.Controller.extend({})
App.CommentsController = Em.Controller.extend({
needs: 'post'
})

would result in a controller that verifies that the post controller exists and exposes a `postController` property defined as:

postController: function() {
this.controllerFor('post');
}.property();

I feel this would make the `needs` property work as expected. Without the pull request `needs` would only verify that the dependency exists in the container with no side effects if the controller does exist.

I don't consider this pull request complete but wanted to get it out there so we can have a public discussion about `needs` in general. I also feel that my current implementation isn't the best way of doing it so feedback on that is welcome too :)