実際に正確な手順に従って ToDOMVC を生成してこれを作成しましたが、以下のエラーが発生する理由を世界で理解できません。
アサーションに失敗しました: #each がループする値は配列でなければなりません。
渡されました (生成された質問コントローラー) ember.js:394 Uncaught TypeError: Object [object Object] has no method 'addArrayObserver'
以下はコードです
index.html
<script type="text/x-handlebars" data-template-name="questions"><!--ACW-not sure should be question or equizz-->
<ul id="question-list" >
{{#each}}
<li>
<h3>{{title}}</h3>
</li>
<li>
<p>{{desc}}</p>
</li>
{{/each}}
</ul>
</script><!--template END-->
アプリケーション.js
window.Equizz = Ember.Application.create();
Equizz.ApplicationAdapter = DS.FixtureAdapter.extend();
router.js
Equizz.Router.map(function () {
this.resource('questions', { path: '/' });
});
Equizz.EquizzRoute = Ember.Route.extend({
model: function () {
return this.store.find('question');
}
});
question.js
Equizz.Question = DS.Model.extend({
qid: DS.attr('string'),
category: DS.attr('string'),
type:DS.attr('string'),
title: DS.attr('string'),
desc: DS.attr('string'),
diff_level: DS.attr('string'),
answer: DS.attr('boolean')
});
Equizz.Question.FIXTURES = [
{
qid: '1',
category: 'Track',
type:'True & False',
title: 'Get 100 in the quizz is the most disgraced act in simulator lab.',
desc: 'think clearly, you should know the answer without use your brain...',
diff_level: 'Hard',
answer: false
},
{
qid: '2',
category: 'Common',
type:'True & False',
title: 'You are allowed to eat in simulator lab.',
desc: 'Like what? Halal?',
diff_level: 'Medium',
answer: false
},
{
qid: '3',
category: 'BS',
type:'True & False',
title: 'fsafasf asf asjfkl; as fkasl; faf a;sf sf asfl; sjlfjs a; fsl fas;f dsaf aslfj asl;fj a;fj alfj slafj a?',
desc: 'Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?Like what? Halal?',
diff_level: 'Easy',
answer: true
}
];