In ionic we can persist data across different sessions of the app using the following approaches:
1. Local Storage
2. SQLite database
We will use local storage plugin, in HTML the local storage had to introduce to overcome some of the limitation of browser cookies.Not all the browser support the local storage.
Step to follow:
Step 1: We will configure the first configure the setting the movie items to and retrieving movie items fromNativeStorage.
First, we will add code for providers/local-storage.ts service
We are implementing to methods setItem and getItem are our own wrapper method around the NativeStorage API methods which themselves are contained within Promises that
return the results of the NativeStorage API method that is being executed.
In the app/app.module.ts, add the following line of code