Created
December 12, 2018 14:21
-
-
Save mhartington/115dacec51ecdb25df09160d417d4e12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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