Using IndexedDB

Besides local and session storage, IndexedDB also provides us with a way to store user data in the browser. IndexedDB is more advanced than local storage: it allows us to store data in object stores and supports indexing the data.

In this recipe, we're going to create a simple todo list app which stores its data in IndexedDB. We're going to use the Angular framework covered in Chapter 10, Data Binding Frameworks to simplify our code. We're going to find out if IndexedDB is a better choice for larger, more complicated data models with more complex search and retrieval needs.

The todo list application will support current and archived items and will allow filtering the items by date.

How to do it...

Let's write the code:

  1. Create index.html ...

Get HTML5 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.