Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Can you bind a view over existing html?

$
0
0
The problem here is the definition of the "view" between frameworks.

Can's closer to an MVC in that sense and the "View" part is always about a template. The "controller" (can.Control) is the one you are looking for here. That handles the events and acts as a mediator between the data and the html*. And of course controller is able to bind on existing html, handle events and update the view**.

Backbone's view (as far as I can tell) seems to act as both a "view" and a "controller" in can. It gets a "model" (I think bb names it "collection") and all event handling and rendering happens in a view.


*  Things blend a bit more with components and MVVM but even there there is a separation of even handling and the view. 
** Live updating changed a lot the way you update elements in the DOM nowadays. Usually you just have an object representing a state and the controller just updates that object and then live binding does the dirty job.

Viewing all articles
Browse latest Browse all 3491

Latest Images

Trending Articles



Latest Images