Getting started with the ember tutorial: changing the router to “display model data” causes errors

So forgive me in advance, I'm obviously completely new to ember (and quite new to JS in general). I move on to an advanced getting started tutorial, following it up the line (if I haven't missed something) when my browser decides to do nothing but the background. I stepped back and noticed that this happens immediately after changing the router, as shown here: http://emberjs.com/guides/getting-started/displaying-model-data/

I committed and clicked on github here: https://github.com/justuseapen/ember_tut_mock

^ The first commit displayed in the browser is ok, the second commit is broken if you want to see the difference.

This is my console output:

Uncaught ReferenceError: Todos is not defined todo.js:1
DEBUG: ------------------------------- ember.js:394
DEBUG: Ember.VERSION : 1.0.0 ember.js:394
DEBUG: Handlebars.VERSION : 1.0.0 ember.js:394
DEBUG: jQuery.VERSION : 1.10.2 ember.js:394
DEBUG: ------------------------------- ember.js:394
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
Assertion failed: No model was found for 'todo' ember.js:394
(anonymous function) ember.js:394
DEPRECATION: Action handlers contained in an `events` object are deprecated in favor of 

putting them in an `actions` object (error on <Ember.Route:ember222>)
            at Object.triggerEvent
Error while loading route: 
TypeError
 ember.js:394
Uncaught TypeError: Cannot set property 'store' of undefined 

This is the router.js that breaks the code:
Todos.Router.map(function () {
  this.resource('todos', { path: '/' });
});

Todos.TodosRoute = Ember.Route.extend({
  model: function () {
    return this.store.find('todo');
  }
});

:

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
 }
];

.

+4
1

Ember Data (, Ember/Ember Data)

http://emberjs.jsbin.com/OpOsIGEK/1/edit

0

All Articles