My main issue is because I’m using superTabsModule, i have a page to the superTabs (HomePage), and others pages to insert data, well if i send the parameters to a specific page something like this shows up:
You could use ionic-storage to get and set values just as you would with local storage. These are persistent though so can even survive through killing the app. This is good if you want to access the data across multiple pages and you can even bind objects. If you are only wanting to pass an ID between one page, the method you implemented above is correct.
See: Ionic Storage Docs for more information on how to get started. You won’t need SQLite though unless you want to make things more complex.
Then set the item using the following:
this.storage.set('idNameForQuickReference',id);
and you can get that same item across multiple pages with:
this.storage.get('idNameForQuickReference').then(val => { console.log('Your ID is ' + val) });
You can even store objects if you want multiple ID’s.
I disagree with the advice in the previous post, and think storage should only be used to persist across app quit/restart, for three reasons:
it is extremely easy to bite yourself with insidious race conditions, and the code necessary to protect against them is tricky and error-prone
it is less performant than simply using Observables in a provider or NavParams
in many if not most cases, you don’t want this data to persist across app restarts, so now you have to write extra needless initialization code to clear it out at app startup