Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Backbone.js Patterns and Best Practices
  • Table Of Contents Toc
  • Feedback & Rating feedback
Backbone.js Patterns and Best Practices

Backbone.js Patterns and Best Practices

By : Swarnendu De
4.3 (9)
close
close
Backbone.js Patterns and Best Practices

Backbone.js Patterns and Best Practices

4.3 (9)
By: Swarnendu De

Overview of this book

Table of Contents (19 chapters)
close
close
Backbone.js Patterns and Best Practices
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
2
Precompiling Templates on the Server Side
4
Index

Chapter 5. Routing Best Practices and Subrouting

A router is one of the most useful objects in Backbone; it is mainly used to route application URLs using hash fragments or standard URLs. In the earlier versions of Backbone, Backbone.Controller was used to take care of routing as well as default controller tasks, instead of Backbone.Router. Later, it was changed to Backbone.Router, because the router is meant to only handle routing client side pages and connect them to events and actions via URLs, while the functional logic must be taken care of by the presenters (that is, Backbone views). The concept of a router is pretty straightforward—it matches the method name to the URL fragment and calls the method. The method then takes care of the events and actions as required.

In this chapter, we will learn about some best practices, such as how to organize routers for medium- and large-scale applications, and which types of tasks should be handled by a router. The main topics to be covered are...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Backbone.js Patterns and Best Practices
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon