I am new in Backbone.js and I keep failing to understand how the model and the view are connected.
I played with Angular where things are pretty clear there, how model, view and controller are connected.
I know Angular and Backbone are different and the latter is MV*.
In Backbone I can understand how model and view are created and work, but how are they connected? Seems to me they are seperated.
Please take a minute to explain or point me to a tutorial.
Thanks in advance
EDIT
OK, here is an example. It happens that I read the book that trolle suggests. This is a code from the book's github
I start reading. I understand the Todo
model. I understand the TodoList
collection. Then I get to the TodoView
- creates a new
li
- uses Underscore template to compile html
- defines some functions that imlements later in the same view
- defines an initialize function
inside that function
what is this? this.model.bind('change', this.render, this);
how he can magically bind the action change
to a model? How the code knows about the model? When he defined the model and how? Just because is there, the code knows that model
= Todo
model?
How does he do that bind? What am I missing.
This confuses me, so reading AppView
view does not help me much
Thanks again