Skip to content

Instantly share code, notes, and snippets.

@mhartington
Created December 12, 2018 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhartington/115dacec51ecdb25df09160d417d4e12 to your computer and use it in GitHub Desktop.
Save mhartington/115dacec51ecdb25df09160d417d4e12 to your computer and use it in GitHub Desktop.
import { Injectable } from '@angular/core';
import { CanLoad, Router } from '@angular/router';
import { Storage } from '@ionic/storage';
@Injectable({
providedIn: 'root'
})
export class CheckTutorial implements CanLoad {
constructor(private storage: Storage, private router: Router) {}
canLoad() {
return this.storage.get('ion_did_tutorial').then(res => {
if (res) {
this.router.navigate(['/app', 'tabs', 'schedule']);
return false;
} else {
return true;
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment