我正在关注以下教程:
http://arturalib.com/hello-backbonejs/docs/3.html
这是我坚持的一段代码:
initialize: function(){
_.bindAll(this, 'render', 'addItem', 'appendItem'); // remember: every function that uses 'this' as the current object should be in here
this.collection = new List();
this.collection.bind('add', this.appendItem); // collection event binder
this.counter = 0;
this.render();
},
我很难理解的代码行是:
this.collection.bind('add', this.appendItem);
我知道下划线中有一个绑定方法,但我认为这不是同一个绑定函数。
你能解释一下上面的行是什么,我可以在哪里阅读更多关于它的信息?