Last active
September 29, 2018 10:15
-
-
Save samarthagarwal/d465171fcaf62c5584a8bcc1f9cb3f0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core' | |
import { Storage } from '@ionic/storage' | |
@Component({ | |
selector: 'app-home', | |
templateUrl: 'home.page.html', | |
styleUrls: ['home.page.scss'], | |
}) | |
export class HomePage { | |
constructor(private storage: Storage){ | |
// set a key/value | |
\!h storage.set('name', 'Max'); | |
// Or to get a key/value pair | |
\!h storage.get('age').then((val) => { | |
\!h console.log('Your age is', val); | |
\!h }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment