emberjs/ember.js — pull request #2959 by stefanpenner (2013-07-04 23:13:21+00:00)
Title: Add Route#viewFor

This gives routes a first class way to access view instances.
For example creating a popup from the route as the result of an
event.

Although typically I use an specified popup outlet for popups,
I have seen the pattern of creating and instantiating view instances
for popups at both the controller and route. If this is going to
happen I would feel more comfortable with it happening at the route.

Views looked up via this abstraction:
- are automatically given a container
- are easily replaced for tests
- can now be registered on the container, providing a potential hook for 3rd part add-ons, such as a twitter bootstrap confirmation dialog, to register against.

Example:

```javascript
Ember.Route.extend({
// ...
events: {
confirm: function() {
var view = this.viewfor('confirmation');
// ...
}
}
})
```