我在使用ember.js时遇到了很大的麻烦.当我在http://emberjs.com/guides/getting-started/adding-a-route-and-template/中添加以下代码时,我的所有内容都消失了.
Firebug检测:"ReferenceError:Todos未定义",但是在index.html中正确加载的todo.js中定义:
todo.js
Todos.Todo = DS.Model.extend({
title: DS.attr('string'),
isCompleted: DS.attr('boolean')
});
Todos.Todo.FIXTURES = [
{
id: 1,
title: 'Learn Ember.js',
isCompleted: true
},
{
id: 2,
title: '...',
isCompleted: false
},
{
id: 3,
title: 'Profit!',
isCompleted: false
}
];
Run Code Online (Sandbox Code Playgroud)
这是我所有文件的链接:https://gist.github.com/anonymous/6416743(不包括基本js文件).
我在教程中做了所有事情,直到http://emberjs.com/guides/getting-started/displaying-model-data/
谢谢你的帮助.
ember.js ×1