/// import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { Storage } from '@ionic/storage'; @Component({ selector: 'settings', templateUrl: 'settings.html' }) export class SettingsPage { user: User = { strongs_modal: true }; constructor(public navCtrl: NavController, public local: Storage) { // Check if there is a profile saved in local storage this.local.get('profile').then(profile => { if (profile === null) { this.save(); } else this.user = JSON.parse(profile); }).catch(error => { console.log(error); }); } save() { this.local.set('profile', JSON.stringify(this.user)); } ionViewDidLoad() { console.log('Hello SettingsPage Page'); } }