Backbone.Marionette.js: A Gentle Introduction
- Length: 244 pages
- Edition: 1
- Language: English
- Publisher: Leanpub
- Publication Date: 2013-11-08
Backbone.js has become a popular library for developing modern web applications as their complexity and size increase. With Marionette.js, boilerplate code is handled by the library, letting you focus on your application’s specifics. You’ll discover Marionette components, along with when and why to use them. After you’ve made it through the book, you’ll be comfortable writing a Marionette application on your own.
Exercises covering the basic concepts are included (with solutions), so you can check for yourself if you’ve properly understood the functionality that was covered in a given chapter.
You’ll learn how to build the application at davidsulc step by step, including:
- Structuring your large apps with modules to manage complexity
- Using regions and layouts to segment your displays and make them manageable
- Managing forms, along with error display
- Handling data latency and displaying loading views
- Filtering collections and updating views, matching URL fragments to filtering criteria
- Extending the Marionette framework to clean up your code and make your life easier
- Using mixins to add common functionality to objects
- Defining your own view classes to extend from, sharing common behavior
- Implementing Backbone routing properly
- Swapping sub-applications
- Managing menu entries with non-persisted models
And much more! All of this is covered step by step so you fully understand how and why code is being added, removed, or refactored.
What you need
A recent browser to run the web application. All development will be local, so you won’t be required to have a running server. Code excerpts are in JavaScript, and assume a working knowledge of the language, as well as DOM manipulation. Code commits are available in a Git repository, but can also be perused on the web, or downloaded (without requiring Git).
Table of Contents
Chapter 1. Setting Up
Chapter 2. Displaying a Static View
Chapter 3. Displaying a Model
Chapter 4. Displaying a Collection of Models
Chapter 5. Structuring Code with Modules
Chapter 6. Using a CompositeView
Chapter 7. Events, Bubbling, and TriggerMethod
Chapter 8. Displaying Contacts in Dedicated Views
Chapter 9. Implementing Routing
Chapter 10. Implementing a View for Nonexistent Contacts
Chapter 11. Dealing with Persisted Data
Chapter 12. Handling Data Latency
Chapter 13. Managing Forms: Editing a Contact
Chapter 14. Displaying a Modal Window
Chapter 15. Subdividing Complex Views with Layouts
Chapter 16. Extending from Base Views
Chapter 17. Managing Dialogs with a Dedicated Region
Chapter 18. Filtering Contacts
Chapter 19. The `About’ Sub-Application
Chapter 20. The `Header’ Sub-Application
Chapter 21. Closing Thoughts
Chapter 22. Other Books I’ve Written
Chapter 23. Module Architecture
Chapter 24. Exercise Solutions
Chapter 25. Overriding Marionette’s Template Loader
Chapter 26. Extending Marionette
Chapter 27. Using Web Storage for Persistence
Chapter 28. Creating a FilteredCollection