Browse Source

added button icons in menu

Shivam Patel 6 years ago
parent
commit
58e7c1683e

+ 7
- 7
src/app/app.component.ts View File

@@ -8,7 +8,7 @@ import { ListPage } from '../pages/list/list';
8 8
 import { ActiveConnections } from '../pages/active/active';
9 9
 import { History } from '../pages/history/history';
10 10
 import { Notes } from '../pages/notes/notes';
11
-import {SettingsPage} from '../pages/settings/settings'
11
+import {Settings} from '../pages/settings/settings'
12 12
 
13 13
 
14 14
 
@@ -21,7 +21,7 @@ export class MyApp {
21 21
 
22 22
   rootPage: any = HomePage;
23 23
 
24
-  pages: Array<{title: string, component: any}>;
24
+  pages: Array<{title: string, component: any, icon: string}>;
25 25
 
26 26
   constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
27 27
    
@@ -31,12 +31,12 @@ export class MyApp {
31 31
 
32 32
     // used for an example of ngFor and navigation
33 33
     this.pages = [
34
-      { title: 'Home', component: HomePage },
34
+      { title: 'Home', component: HomePage, icon: 'home'},
35 35
       //{ title: 'ListOfLists', component: ListPage },
36
-      { title: 'Active Connections', component: ActiveConnections },
37
-      { title: 'History', component: History },
38
-      { title: 'Notes', component: Notes },
39
-      {title: 'Settings', component: SettingsPage}
36
+      { title: 'Active Connections', component: ActiveConnections, icon: 'wifi'},
37
+      { title: 'History', component: History, icon: 'archive' },
38
+      { title: 'Notes', component: Notes, icon: 'create' },
39
+      {title: 'Settings', component: Settings, icon: 'settings'}
40 40
     ];
41 41
 
42 42
   }

+ 1
- 0
src/app/app.html View File

@@ -8,6 +8,7 @@
8 8
   <ion-content>
9 9
     <ion-list>
10 10
       <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
11
+        <ion-icon [name]="p.icon" item-left></ion-icon>
11 12
         {{p.title}}
12 13
       </button>
13 14
     </ion-list>

+ 6
- 2
src/pages/active/active.html View File

@@ -7,12 +7,16 @@
7 7
 <ion-header>
8 8
 
9 9
   <ion-navbar>
10
-    <ion-title>Active</ion-title>
10
+    <ion-title>Active Connections</ion-title>
11 11
   </ion-navbar>
12 12
 
13 13
 </ion-header>
14 14
 
15 15
 
16
-<ion-content padding>
16
+<ion-content>
17
+
18
+<ion-list>
19
+  <ion-item *ngFor="let Connection of Connections">{{Connection}}</ion-item>
20
+</ion-list>
17 21
 
18 22
 </ion-content>

+ 3
- 3
src/pages/active/active.module.ts View File

@@ -1,13 +1,13 @@
1 1
 import { NgModule } from '@angular/core';
2 2
 import { IonicPageModule } from 'ionic-angular';
3
-import { ActivePage } from './active';
3
+import { ActiveConnections } from './active';
4 4
 
5 5
 @NgModule({
6 6
   declarations: [
7
-    ActivePage,
7
+    ActiveConnections,
8 8
   ],
9 9
   imports: [
10
-    IonicPageModule.forChild(ActivePage),
10
+    IonicPageModule.forChild(ActiveConnections),
11 11
   ],
12 12
 })
13 13
 export class ActivePageModule {}

+ 8
- 3
src/pages/active/active.ts View File

@@ -15,11 +15,16 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
15 15
 })
16 16
 export class ActiveConnections {
17 17
 
18
+  connections: any;
19
+
18 20
   constructor(public navCtrl: NavController, public navParams: NavParams) {
19
-  }
21
+  
22
+
23
+  this.connections = [
24
+    'Device 1',
25
+    'Device 2'
20 26
 
21
-  ionViewDidLoad() {
22
-    console.log('ionViewDidLoad ActivePage');
27
+  ];
23 28
   }
24 29
 
25 30
 }

+ 6
- 0
src/pages/home/home.html View File

@@ -1,9 +1,11 @@
1 1
 <ion-header>
2
+  
2 3
   <ion-navbar>
3 4
     <button ion-button menuToggle>
4 5
       <ion-icon name="menu"></ion-icon>
5 6
     </button>
6 7
     <ion-title>Home</ion-title>
8
+  
7 9
   </ion-navbar>
8 10
 </ion-header>
9 11
 
@@ -14,4 +16,8 @@
14 16
   <p>This is the wyds homepage</p>
15 17
 
16 18
   <button ion-button secondary menuToggle>Click for Menu</button>
19
+
20
+  
21
+
22
+
17 23
 </ion-content>