Summary
In this chapter, we learned how to keep models and views in sync. In general, syncing model and views is easy but things can turn difficult if the model has embedded arrays. You can use a plugin to simplify the data binding; Backbone.Stickit is a good option because it allows you to make your bindings in a declarative way.
I showed you how you can make two-way data binding with a vanilla Backbone, taking advantage of the event system; it's not always a good idea to use intensive two-way data binding in your applications but in some cases it can be useful.
Finally, we learned how to validate models with Backbone and how to use the validation API to show error messages in views. The Backbone.Validation plugin can help you to validate Backbone ...
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