Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70770

Ionic Storage Async Await Crashing

$
0
0

@roccosifreddi wrote:

I have created a service for a storage set with a UUID and want to get() the value in the console, but it just crashes on every single attempt in Chrome and an emulator. Is something wrong with my code?
By the way, set() works but not get()


  constructor(public storage: Storage) { }

  public async setParam(name: string, value: any) {
    return await this.storage.set(name, value);
  }

  public getParam(name: string): Promise<any> {
    return this.storage.get(name).then((val) => { console.log(val); });
  }
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70770

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>