emberjs/ember.js — pull request #3424 by mmun (2013-09-15 17:11:59+00:00)
Title: Add Ember.computed.controller

This is an idea for working with nested array controllers and for sharing array/item controllers between multiple views.

Here is a demo in action: http://jsbin.com/ULuqIPe/1/edit

And here are the docs:

A computed property that creates a controller. This computed property should
only be used on a controller. The controller class is specified by
`controllerName` and must be explicitly defined. The content of the
controller must be is specified by the `contentPath` parameter. The generated
controller has access to the parent controller through its `parentController`
property. Any actions emitted from the generated controller will pass through
the parent controller.

```javascript
App.PostController = Ember.ObjectController.extend({
comments: Ember.computed.controller('comments', 'model.comments');
});

// Must be defined
App.CommentsController = Ember.ArrayController.extend();
```

@method computed.controller
@for Ember
@param {String} controllerName
@param {String} contentPath
@return {Ember.ComputedProperty} computed property which creates a
controller with content from `contentPath`.