Permalink
Browse files

using 'listenTo' instead of 'on' in todos example app

  • Loading branch information...
1 parent 0085732 commit bb0d3519501a35869a40f91b61da6f10e230f7b0 @yuku-t yuku-t committed Dec 14, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 examples/todos/todos.js
View
@@ -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.
@@ -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');

0 comments on commit bb0d351

Please sign in to comment.