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

Ionic - Get storage values globally

$
0
0

@cybentizens wrote:

Hi

Let me tell you the scope first:

My app has more than 100 pages and I’m storing font values to ionic storage.

Currently I’m getting these values in each page like this:

//Get English Key
this.storage.get('showEnglishKey').then(showEnglishKey=> {
  if(showEnglishKey== 'true') {
    document.getElementsByClassName("classSelector")[0].classList.add("showEnglish");
  } else {
    document.getElementsByClassName("classSelector")[0].classList.remove('showEnglish');
  }
});

Suppose, if I want to change anything then I’ve to change in all my 100+ pages.

Is there any method/function that I’ll save it in one function/page and just call it.

Best Regards

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



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