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

Create onboarding and its guard

$
0
0

Hello, I want to create a onboarding for my app. This is just a single page containing slides. Now this should be just shown, when the user enters the app the first time. For this, I thought I add an item ‘onboarded’ to the localStorage. Now the guard just needs to look if it gets a response when calling this property:

canActivate() {
    this.storageService.get(Constants.ONBOARDED).then( res => {
      if(!res) {
        return true;
      } else {
        return false;
      }
    })
  }

Now I have the problem, that not all paths return a value. Should I put the Prmoise in the onInit or is there a way to use a resolver to push the data to the guard before it is actually called?

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



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