Tutorial hero
Lesson icon

A Simple Guide to Saving Data in Ionic 2

Originally published January 05, 2017 Time 2 mins

Many applications require the ability to save data in some manner so that a user can perform some actions in the application, close the application, and have the application remember the user’s input from the last time they opened the application.

By default, anything you do within your application is just going to be lost as soon as the user closes the application. This is fine for some applications, but that’s not really going to work for a note taking application.

In order to persist data throughout different sessions, there are multiple different methods we can use, but one simple way to do this is to use the built-in Storage service that Ionic 2 provides.

In this video tutorial, we will walk through what the Ionic 2 Storage service is, how it works, and how to use it. Here’s the video:

Video Notes

  • The Storage service Ionic 2 provides will automatically use the best storage available

  • A native SQLite database will be preferred where available

  • Browser based storage (like local storage and WebSQL) will be used as a fallback

  • Browser based storage has limited capacity and can be wiped at any time by the operating system. Although it is not common for the memory to be wiped, it is possible, so you should not use it for data you need to store permanently

Learn to build modern Angular apps with my course