Wrapping Up
We have seen how CanJS offers a really nice way of structuring a JavaScript application into models, views, and controllers. Models are not just data containers; they drive the application by signaling changes to other parts of the application and by synchronizing with the server. Views, with the simplicity of the Mustache syntax, are easy to read, and they automatically update themselves to reflect model changes. Controllers combine models and views into components that handle UI events.
CanJS’s Strengths
CanJS gives an excellent balance of functionality and transparency. That is, you get great features without sacrificing clarity: your code remains straightforward JavaScript, with no black magic going on.
The library is lightweight ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access