Chapter 11. Navigating offline data
This chapter covers
- Handling browser navigation in a single-page app
- Storing cookies to remember user settings
- Serializing objects to JSON
- Storing offline data in the browser
Users are accustomed to using built-in browser navigation tools, such as the browser’s forward and back buttons and bookmarks, to navigate web apps in the same way they have been doing for years with normal websites. Users also expect apps to have fast response times, which apps achieve by persisting data offline.
Modern browser technology makes it possible to meet your users’ expectations. In this chapter you’ll add these features to the DartExpense example application you started in the previous chapter.
In a single-page web app, when the user switches between two views, such as from list view to edit view, they expect to be able to use the browser’s back button to navigate back to the prior view. Your app, therefore, needs be able to notify the web browser that a view change has occurred. We’ll look at how you can manipulate the browser’s history to make it possible to use back-button navigation and to bookmark specific views.