|
@@ -0,0 +1,101 @@
|
|
1
|
+// import { Component, ViewChild } from '@angular/core';
|
|
2
|
+// import { IonicPage, NavController, NavParams, Nav } from 'ionic-angular';
|
|
3
|
+// import { HomePage } from '../home/home';
|
|
4
|
+
|
|
5
|
+// /**
|
|
6
|
+// * Generated class for the MenuPage page.
|
|
7
|
+// *
|
|
8
|
+// * See https://ionicframework.com/docs/components/#navigation for more info on
|
|
9
|
+// * Ionic pages and navigation.
|
|
10
|
+// */
|
|
11
|
+
|
|
12
|
+// export interface PageInterface {
|
|
13
|
+// title: string;
|
|
14
|
+// pageName: string;
|
|
15
|
+// tabComponent?: any;
|
|
16
|
+// index?: number;
|
|
17
|
+// icon: string;
|
|
18
|
+// }
|
|
19
|
+
|
|
20
|
+// @IonicPage()
|
|
21
|
+// @Component({
|
|
22
|
+// selector: 'page-menu',
|
|
23
|
+// templateUrl: 'menu.html',
|
|
24
|
+// })
|
|
25
|
+// export class MenuPage {
|
|
26
|
+// //basic root for our
|
|
27
|
+// rootPage = 'HomePage';
|
|
28
|
+
|
|
29
|
+// @ViewChild(Nav) nav: Nav;
|
|
30
|
+
|
|
31
|
+// pages: PageInterface[] = [
|
|
32
|
+// { title: 'My Vault', pageName: 'HomePage', index: 0, icon: 'home' }
|
|
33
|
+// ];
|
|
34
|
+
|
|
35
|
+// constructor(public navCtrl: NavController, public navParams: NavParams) {
|
|
36
|
+// }
|
|
37
|
+
|
|
38
|
+// openPage(page: PageInterface) {
|
|
39
|
+// let params = {};
|
|
40
|
+
|
|
41
|
+// if (this.nav.getActiveChildNav() && page.index != undefined) {
|
|
42
|
+// this.nav.getActiveChildNav().select(page.index);
|
|
43
|
+// }
|
|
44
|
+// else {
|
|
45
|
+// this.nav.setRoot(page.pageName, params);
|
|
46
|
+// }
|
|
47
|
+// }
|
|
48
|
+
|
|
49
|
+// isActive(page: PageInterface) {
|
|
50
|
+// if (this.nav.getActive() && this.nav.getActive().name === page.pageName) {
|
|
51
|
+// return 'primary';
|
|
52
|
+// }
|
|
53
|
+// return;
|
|
54
|
+// }
|
|
55
|
+
|
|
56
|
+// ionViewDidLoad() {
|
|
57
|
+// console.log('ionViewDidLoad MenuPage');
|
|
58
|
+// }
|
|
59
|
+
|
|
60
|
+// }
|
|
61
|
+
|
|
62
|
+import { Component, ViewChild } from '@angular/core';
|
|
63
|
+import { IonicPage, Nav, NavController } from 'ionic-angular';
|
|
64
|
+
|
|
65
|
+interface PageItem {
|
|
66
|
+ title: string
|
|
67
|
+ component: any
|
|
68
|
+}
|
|
69
|
+type PageList = PageItem[]
|
|
70
|
+
|
|
71
|
+@IonicPage()
|
|
72
|
+@Component({
|
|
73
|
+ selector: 'page-menu',
|
|
74
|
+ templateUrl: 'menu.html'
|
|
75
|
+})
|
|
76
|
+export class MenuPage {
|
|
77
|
+ // A reference to the ion-nav in our component
|
|
78
|
+ @ViewChild(Nav) nav: Nav;
|
|
79
|
+
|
|
80
|
+ rootPage: any = 'ContentPage';
|
|
81
|
+
|
|
82
|
+ pages: PageList;
|
|
83
|
+
|
|
84
|
+ constructor(public navCtrl: NavController) {
|
|
85
|
+ // used for an example of ngFor and navigation
|
|
86
|
+ this.pages = [
|
|
87
|
+ { title: 'Sign in', component: 'LoginPage' },
|
|
88
|
+ { title: 'Signup', component: 'SignupPage' }
|
|
89
|
+ ];
|
|
90
|
+ }
|
|
91
|
+
|
|
92
|
+ ionViewDidLoad() {
|
|
93
|
+ console.log('Hello MenuPage Page');
|
|
94
|
+ }
|
|
95
|
+
|
|
96
|
+ openPage(page: PageItem) {
|
|
97
|
+ // Reset the content nav to have just this page
|
|
98
|
+ // we wouldn't want the back button to show in this scenario
|
|
99
|
+ this.nav.setRoot(page.component);
|
|
100
|
+ }
|
|
101
|
+}
|