Just started with backbone.js and javascript. On my collection, I can listen for 'reset' event and make it call the 'render' function of my view(this). But I add the view into the DOM in my router like this:
$('#container').html(view.render().el)
I call render().el (which i assume returns some HTML text) and add it to my container div. Calling render on my view alone is useless. So why does my view update perfectly on 'reset' event which merely calls the render function (which is useless as it just returns self(a view object), the actual updating occurs in my router where the view's rendered el gets append into my container div)?
I am following a tutorial that why I know the answer, just don't know the reason behind it.
Thanks