emberjs/ember.js — pull request #1323 by redotheoffice (2012-08-25 13:20:21+00:00)
Title: Make the collection view insertion point custom

In the current implementation collection view injects the 'content' property into its child view.
Personally I like some flexibility here, to allow for better nomenclature in my view objects.

As an example I made a simple number to image replacement. It's used in a game, where custom artwork is often much nicer than browser fonts.

```javascript
App.DigitView = Ember.View.extend({
tagName: "img",
classNames: ['digit'],
attributeBindings: ['src'],

digit: 0,

src: function() {
return 'img/number_'+this.get('digit')+'.png';
}.property('digit')
});

App.NumberView = Ember.CollectionView.extend({
itemViewClass: App.DigitView,
itemViewProperty: "digit",
tagName: "span",

number: 0,

content: function() {
return (this.get('number')+'').split('');
}.property('number')
});
```

Using the current implementation I'm forced to use the 'content' property in DigitView, which makes the purpose of the view less clear.

```javascript
App.DigitView = Ember.View.extend({
tagName: "img",
classNames: ['digit'],
attributeBindings: ['src'],

content: 0,

src: function() {
return 'img/number_'+this.get('content')+'.png';
}.property('content')
});
```