Skip to content

Commit 8ea32aa

Browse files
authored
Merge pull request #15 from SoftStackFactory/dev
Dev
2 parents 3343709 + 0ab9eb6 commit 8ea32aa

30 files changed

Lines changed: 507 additions & 22 deletions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "ionic-app-scripts build --prod",
1212
"lint": "ionic-app-scripts lint",
1313
"ionic:build": "ionic-app-scripts build",
14-
"ionic:serve": "ionic-app-scripts serve --no-devapp --no-open --port 3000"
14+
"ionic:serve": "ionic-app-scripts serve --no-devapp --no-open --port 3000 --address localhost"
1515
},
1616
"dependencies": {
1717
"@angular/animations": "5.2.11",

src/app/app.component.ts

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,58 @@
1-
import { Component } from '@angular/core';
2-
import { Platform } from 'ionic-angular';
1+
import { Component, ViewChild } from '@angular/core';
2+
import { Nav, Platform } from 'ionic-angular';
33
import { StatusBar } from '@ionic-native/status-bar';
44
import { SplashScreen } from '@ionic-native/splash-screen';
55

66
import { HomePage } from '../pages/home/home';
7+
import { LoginPage } from '../pages/login/login';
8+
import { RegisterPage } from '../pages/register/register';
9+
import { WizardPage } from '../pages/wizard/wizard';
10+
import { DashboardPage } from '../pages/dashboard/dashboard';
11+
import { ProfilePage } from '../pages/profile/profile';
12+
import { TransitionPage } from '../pages/transition/transition';
13+
import { AssessmentPage } from '../pages/assessment/assessment';
14+
import { TimelinePage } from '../pages/timeline/timeline';
15+
716
@Component({
817
templateUrl: 'app.html'
918
})
1019
export class MyApp {
11-
rootPage:any = HomePage;
20+
@ViewChild(Nav) nav: Nav;
21+
22+
rootPage: any = HomePage;
23+
24+
pages: Array<{title: string, component: any}>;
25+
26+
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
27+
this.initializeApp();
28+
29+
// used for an example of ngFor and navigation
30+
this.pages = [
31+
{ title: 'Home', component: HomePage },
32+
{ title: 'Login', component: LoginPage },
33+
{ title: 'Register', component: RegisterPage },
34+
{ title: 'Wizard', component: WizardPage },
35+
{ title: 'Dashboard', component: DashboardPage },
36+
{ title: 'Profile', component: ProfilePage },
37+
{ title: 'Transition', component: TransitionPage },
38+
{ title: 'Assessment', component: AssessmentPage },
39+
{ title: 'Timeline', component: TimelinePage }
40+
];
1241

13-
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
14-
platform.ready().then(() => {
42+
}
43+
44+
initializeApp() {
45+
this.platform.ready().then(() => {
1546
// Okay, so the platform is ready and our plugins are available.
1647
// Here you can do any higher level native things you might need.
17-
statusBar.styleDefault();
18-
splashScreen.hide();
48+
this.statusBar.styleDefault();
49+
this.splashScreen.hide();
1950
});
2051
}
21-
}
2252

53+
openPage(page) {
54+
// Reset the content nav to have just this page
55+
// we wouldn't want the back button to show in this scenario
56+
this.nav.setRoot(page.component);
57+
}
58+
}

src/app/app.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
<ion-nav [root]="rootPage"></ion-nav>
1+
<ion-menu [content]="content">
2+
<ion-header>
3+
<ion-toolbar>
4+
<ion-title>Menu</ion-title>
5+
</ion-toolbar>
6+
</ion-header>
7+
8+
<ion-content>
9+
<ion-list>
10+
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
11+
{{p.title}}
12+
</button>
13+
</ion-list>
14+
</ion-content>
15+
16+
</ion-menu>
17+
18+
<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
19+
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>

src/app/app.module.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,27 @@ import { StatusBar } from '@ionic-native/status-bar';
66

77
import { MyApp } from './app.component';
88
import { HomePage } from '../pages/home/home';
9+
import { LoginPage } from '../pages/login/login';
10+
import { RegisterPage } from '../pages/register/register';
11+
import { WizardPage } from '../pages/wizard/wizard';
12+
import { DashboardPage } from '../pages/dashboard/dashboard';
13+
import { ProfilePage } from '../pages/profile/profile';
14+
import { TransitionPage } from '../pages/transition/transition';
15+
import { AssessmentPage } from '../pages/assessment/assessment';
16+
import { TimelinePage } from '../pages/timeline/timeline';
917

1018
@NgModule({
1119
declarations: [
1220
MyApp,
13-
HomePage
21+
HomePage,
22+
LoginPage,
23+
RegisterPage,
24+
WizardPage,
25+
DashboardPage,
26+
ProfilePage,
27+
TransitionPage,
28+
AssessmentPage,
29+
TimelinePage
1430
],
1531
imports: [
1632
BrowserModule,
@@ -19,7 +35,15 @@ import { HomePage } from '../pages/home/home';
1935
bootstrap: [IonicApp],
2036
entryComponents: [
2137
MyApp,
22-
HomePage
38+
HomePage,
39+
LoginPage,
40+
RegisterPage,
41+
WizardPage,
42+
DashboardPage,
43+
ProfilePage,
44+
TransitionPage,
45+
AssessmentPage,
46+
TimelinePage
2347
],
2448
providers: [
2549
StatusBar,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
Generated template for the AssessmentPage page.
3+
4+
See http://ionicframework.com/docs/components/#navigation for more info on
5+
Ionic pages and navigation.
6+
-->
7+
<ion-header>
8+
<ion-navbar>
9+
<button ion-button menuToggle>
10+
<ion-icon name="menu"></ion-icon>
11+
</button>
12+
<ion-title>Assessment</ion-title>
13+
</ion-navbar>
14+
</ion-header>
15+
16+
17+
<ion-content padding>
18+
19+
</ion-content>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
page-assessment {
2+
3+
}

src/pages/assessment/assessment.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Component } from '@angular/core';
2+
import { NavController, NavParams } from 'ionic-angular';
3+
4+
/**
5+
* Generated class for the AssessmentPage page.
6+
*
7+
* See https://ionicframework.com/docs/components/#navigation for more info on
8+
* Ionic pages and navigation.
9+
*/
10+
11+
@Component({
12+
selector: 'page-assessment',
13+
templateUrl: 'assessment.html',
14+
})
15+
export class AssessmentPage {
16+
17+
constructor(public navCtrl: NavController, public navParams: NavParams) {
18+
}
19+
20+
ionViewDidLoad() {
21+
console.log('ionViewDidLoad AssessmentPage');
22+
}
23+
24+
}

src/pages/dashboard/dashboard.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
Generated template for the DashboardPage page.
3+
4+
See http://ionicframework.com/docs/components/#navigation for more info on
5+
Ionic pages and navigation.
6+
-->
7+
<ion-header>
8+
<ion-navbar>
9+
<button ion-button menuToggle>
10+
<ion-icon name="menu"></ion-icon>
11+
</button>
12+
<ion-title>Dashboard</ion-title>
13+
</ion-navbar>
14+
</ion-header>
15+
16+
17+
<ion-content padding>
18+
19+
</ion-content>

src/pages/dashboard/dashboard.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
page-dashboard {
2+
3+
}

src/pages/dashboard/dashboard.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Component } from '@angular/core';
2+
import { NavController, NavParams } from 'ionic-angular';
3+
4+
/**
5+
* Generated class for the DashboardPage page.
6+
*
7+
* See https://ionicframework.com/docs/components/#navigation for more info on
8+
* Ionic pages and navigation.
9+
*/
10+
11+
@Component({
12+
selector: 'page-dashboard',
13+
templateUrl: 'dashboard.html',
14+
})
15+
export class DashboardPage {
16+
17+
constructor(public navCtrl: NavController, public navParams: NavParams) {
18+
}
19+
20+
ionViewDidLoad() {
21+
console.log('ionViewDidLoad DashboardPage');
22+
}
23+
24+
}

0 commit comments

Comments
 (0)