Creating a to-do app using ngStorage for Local Storage
There are many to-do apps out there, but it could get very complex when you just want to explore one capability of the platform or framework. The example in this recipe will leverage the idea of a to-do app to explain how Local Storage works. Most apps use Local Storage as a method to ensure that the app data is persistent and available offline. You will learn some basic knowledge about how to manipulate data by adding, editing, and deleting them. These are some very common operations for any app.
Here is the high-level process:
- Initialize a Local Storage object with some sample data
- Render an array of objects in the frontend
- Allow the user to delete an item in the array and then update Local Storage
- Allow the user to edit an item in the array by using
$ionicPopup
- Allow the user to move the position of an item by manipulating the Local Storage array
You will not access the localStorage
object directly. Instead, you will use an existing module...