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:
Create
index.html
. To simplify our application code, we're going to useangular.js
templates. Our template will contain the following elements:A select to pick between current and archived todos
A date range filter using HTML5 date components
A todo list with a checkbox...