O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required