I'm trying out Ember.js with ember-data, and I have the following application defined:
window.App = Ember.Application.create()
App.store = DS.Store.create
revision: 4
adapter: DS.RESTAdapter.create { bulkCommit: false }
App.Source = DS.Model.extend
# options
primaryKey: '_id'
# fields
name: DS.attr 'string'
raw_text: DS.attr 'string'
App.sourcesController = Ember.ArrayProxy.create
content: App.store.findAll App.Source
App.ListSourcesView = Ember.View.extend
templateName: 'app/templates/sources/list'
sourcesBinding: 'App.sourcesController'
That template looks like this:
<table>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
</tr>
</thead>
<tbody>
{{#each sources}}
{{view App.ShowSourceView sourceBinding="this"}}
{{/each}}
</tbody>
</table>
When I try to load App.ListSourcesView in my page, I get an error in ember-data.js saying: Uncaught TypeError: Cannot read property 'map' of undefined.
I can't figure out what I'm doing wrong, and reading through the source isn't helping my confusion any in this case. Has anyone experienced this, or can tell me what I've defined/not defined incorrectly?