-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathtutorial.ts
42 lines (34 loc) · 976 Bytes
/
tutorial.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { MenuController } from '@ionic/angular';
import { Storage } from '@ionic/storage-angular';
@Component({
selector: 'page-tutorial',
templateUrl: 'tutorial.html',
styleUrls: ['./tutorial.scss'],
})
export class TutorialPage {
showSkip = true;
constructor(
public menu: MenuController,
public router: Router,
public storage: Storage,
) {}
startApp() {
this.router
.navigateByUrl('/app/tabs/schedule', { replaceUrl: true })
.then(() => this.storage.set('ion_did_tutorial', true));
}
ionViewWillEnter() {
this.storage.get('ion_did_tutorial').then(res => {
if (res === true) {
this.router.navigateByUrl('/app/tabs/schedule', { replaceUrl: true });
}
});
this.menu.enable(false);
}
ionViewDidLeave() {
// enable the root left menu when leaving the tutorial page
this.menu.enable(true);
}
}