Skip to content

Commit

Permalink
using 'listenTo' instead of 'on' in todos example app
Browse files Browse the repository at this point in the history
  • Loading branch information
yuku committed Dec 14, 2012
1 parent 0085732 commit bb0d351
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/todos/todos.js
Expand Up @@ -100,8 +100,8 @@ $(function(){
// a one-to-one correspondence between a **Todo** and a **TodoView** in this
// app, we set a direct reference on the model for convenience.
initialize: function() {
this.model.on('change', this.render, this);
this.model.on('destroy', this.remove, this);
this.listenTo(this.model, 'change', this.render);
this.listenTo(this.model, 'destroy', this.remove);
},

// Re-render the titles of the todo item.
Expand Down Expand Up @@ -174,9 +174,9 @@ $(function(){
this.input = this.$("#new-todo");
this.allCheckbox = this.$("#toggle-all")[0];

Todos.on('add', this.addOne, this);
Todos.on('reset', this.addAll, this);
Todos.on('all', this.render, this);
this.listenTo(Todos, 'add', this.addOne);
this.listenTo(Todos, 'reset', this.addAll);
this.listenTo(Todos, 'all', this.render);

this.footer = this.$('footer');
this.main = $('#main');
Expand Down

0 comments on commit bb0d351

Please sign in to comment.