Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public get(key: string) {
- localforage.getItem(key).then(function (value) {
- console.log(value); // exibe o value normalmente, ex.: {nome: 'Joao', idade: '20'}
- return value;
- }).catch(function (err) {
- console.log(err);
- });
- }
- recuperarItem() {
- var object = this.storage.get('pessoa1');
- console.log(object); // undefined
- }
- public get(key: string) {
- return localforage.getItem(key).catch(function (err) {
- console.log(err);
- });
- }
- recuperarItem() {
- this.storage.get().then(function (value) {
- console.log(value);
- })
- }
- public get(key: string) {
- return localforage.getItem(key).catch(function (err) {
- console.log(err);
- });
- }
- async recuperarItem() {
- var object = await this.storage.get();
- console.log(value);
- }
- ...
- localforage.getItem(key).then((value) => {
- ...
Add Comment
Please, Sign In to add comment