emberjs/ember.js — pull request #1491 by jamesarosen (2012-10-24 16:21:39+00:00)
Title: Ember.Handlebars.ViewHelper: extract viewClass lookup

We have been using CommonJS to clean up the structure of our code. This works great for JavaScript code:

```javascript
var MyClass = Ember.Object.extend( require('user_settings_client', {
toString: function() {
return this.get('userSettings.displayName');
}
});
```

Unfortunately, it doesn't work for Handlebars view names:

```handlebars
{{view I.Cant.Use.Require.Here.View}}
```

I wanted to simply swap out `Ember.lookup`, but that needs to be an object, and `require` is a function. The code for actually looking up the view class was mixed in with the rest of the `{{view}}` helper code, but simply extracting is gives us the ability to override it easily.