Retrieving and loading data from Storage


Hi guys, I am building an application and trying to retrieve data from server and display it separately. for this I am using Storage, in app.component.ts I have called the server.ts and stored it to a shared local service:


 constructor(platform: Platform, public jobsData: JobsData, public storage: Storage, public local: Local) {
platform.ready().then(() => {
  // Okay, so the platform is ready and our plugins are available.
  // Here you can do any higher level native things you might need.

  jobsData.load().subscribe(res => {

This is the local service:

 export class Local {

   constructor(public storage: Storage) { }

    setLocalData(data){'data', JSON.stringify(data));

     return'data').then((value) => {
     return JSON.parse(value);

and Im displaying the data on a specific page in the constructor as follows:

local.getLocalData().then((res) => { = res;

On web console it retrieves and displays the data instantly, However, when I build the .apk file and install it on Android and open it for the first time… it does not load anything, until I exit the program and open it again!!!

I don’t know why it does this… Or perhaps if there is a better way to do this!!