Chapter 5. View composition and layout
This chapter covers
- An introduction to layout design
- Steps for composing views
- A guide to designing complex routes
- Insight on how to deal with nested and sibling views
So far you’ve learned some of the basic nuts and bolts of creating a single-page application. During this journey, you learned how to modularize your code and how to use the power of an MV* framework to create the views that your users see and interact with. You also discovered the vital role routers play in your application: they not only allow the natural navigation features of the browser to work with your single page but also provide a way to configure the functionality and views associated with your application’s URLs.
To this point, however, you’ve grasped particular concepts rather than the bigger picture. Now that you have some tools in your SPA toolbox, let’s zoom out and tackle the overall design process for creating a single-page application. Designing a successful SPA is a little like learning to speak a new language. You’ve learned the basics—the vocabulary and grammar—but you still haven’t mastered the dynamics of holding a conversation.