I'm following the official TodoMVC tutorial from Ember.js website. Everything works until the step to display model data: http://emberjs.com/guides/getting-started/displaying-model-data/
The error I'm getting is
Uncaught Error: assertion failed: an Ember.CollectionView's content must implement Ember.Array. You passed <(generated application controller):ember280>
when trying to access each element in the controller with {{#each controller}}
as instructed.
The error disappeared when I changed it into {{#each controller.content}}
. However, nothing was displayed. The documentation said that
This controller is an instance of ArrayController that Ember.js has provided for us as the container for our models
and the API listed length
as a property of the ArrayController
class. But when I tried to {{log controller.length}}
and {{log controller.content.length}}
, I got undefined
as the result.
All this suggested that controller
is not an instance of the Array Controller
class, at least not anymore. So how can I display my model data now?
Thanks!!!