From 7d5fe13dcae0d3b07027ee156e2a0ac017c8fbc8 Mon Sep 17 00:00:00 2001 From: Eumir Gonzales Date: Tue, 5 Jan 2016 16:30:34 +0800 Subject: [PATCH 1/5] Question page file renaming --- app/app.core.scss | 2 +- app/app.ts | 4 ++-- app/pages/{list/list.html => questions/questions.html} | 2 +- app/pages/{list/list.scss => questions/questions.scss} | 0 app/pages/{list/list.ts => questions/questions.ts} | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) rename app/pages/{list/list.html => questions/questions.html} (93%) rename app/pages/{list/list.scss => questions/questions.scss} (100%) rename app/pages/{list/list.ts => questions/questions.ts} (86%) diff --git a/app/app.core.scss b/app/app.core.scss index 1966da3..ec1a199 100644 --- a/app/app.core.scss +++ b/app/app.core.scss @@ -11,4 +11,4 @@ @import "pages/grid/grid"; -@import "pages/list/list"; +@import "pages/questions/questions"; diff --git a/app/app.ts b/app/app.ts index 69bd640..90ad235 100644 --- a/app/app.ts +++ b/app/app.ts @@ -1,7 +1,7 @@ import {App, IonicApp, Platform} from 'ionic-framework/ionic'; import {TeamPage} from './pages/team/team'; -import {ListPage} from './pages/list/list'; +import {QuestionsPage} from './pages/questions/questions'; import {GridPage} from './pages/grid/grid'; @@ -18,7 +18,7 @@ class MyApp { // used for an example of ngFor and navigation this.pages = [ { title: 'Team', component: TeamPage }, - { title: 'Questions', component: ListPage }, + { title: 'Questions', component: QuestionsPage }, { title: 'Account', component: GridPage }, ]; diff --git a/app/pages/list/list.html b/app/pages/questions/questions.html similarity index 93% rename from app/pages/list/list.html rename to app/pages/questions/questions.html index 7770edf..dd0d8bb 100644 --- a/app/pages/list/list.html +++ b/app/pages/questions/questions.html @@ -2,7 +2,7 @@ - Lists + Questions diff --git a/app/pages/list/list.scss b/app/pages/questions/questions.scss similarity index 100% rename from app/pages/list/list.scss rename to app/pages/questions/questions.scss diff --git a/app/pages/list/list.ts b/app/pages/questions/questions.ts similarity index 86% rename from app/pages/list/list.ts rename to app/pages/questions/questions.ts index ba4fb2e..4101af6 100644 --- a/app/pages/list/list.ts +++ b/app/pages/questions/questions.ts @@ -2,9 +2,9 @@ import {IonicApp, Page, NavController, NavParams} from 'ionic-framework/ionic'; @Page({ - templateUrl: 'build/pages/list/list.html' + templateUrl: 'build/pages/questions/questions.html' }) -export class ListPage { +export class QuestionsPage { constructor(app: IonicApp, nav: NavController, navParams: NavParams) { this.nav = nav; @@ -25,7 +25,7 @@ export class ListPage { } itemTapped(event, item) { - this.nav.push(ListPage, { + this.nav.push(QuestionsPage, { item: item }) } From e6c2422a6255407b8a1f573e4088268651094824 Mon Sep 17 00:00:00 2001 From: Eumir Gonzales Date: Tue, 5 Jan 2016 17:13:46 +0800 Subject: [PATCH 2/5] Questions main page draft --- app/pages/questions/questions.html | 37 ++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/app/pages/questions/questions.html b/app/pages/questions/questions.html index dd0d8bb..d681878 100644 --- a/app/pages/questions/questions.html +++ b/app/pages/questions/questions.html @@ -7,14 +7,37 @@ - + Today + + + + +

Eumir

+

Angular 2 question

+

Please teach me how to properly...

+
+ + + + + +

Eumir

+

Javascript question

+

What's a good way to start up a...

+
+ + + +
+ +
You navigated here from {{selectedItem.title}}
From f7eee5d759df4e703863808c83de39c704d7ad7f Mon Sep 17 00:00:00 2001 From: Eumir Gonzales Date: Tue, 5 Jan 2016 18:37:44 +0800 Subject: [PATCH 3/5] Adds blank questions detail page, adds navigation to said page, and deletes unused code --- app/pages/questions/questions.html | 46 ++++++++++-------------- app/pages/questions/questions.ts | 24 +++---------- app/pages/questions/questionsdetail.html | 10 ++++++ app/pages/questions/questionsdetail.scss | 0 app/pages/questions/questionsdetail.ts | 12 +++++++ 5 files changed, 44 insertions(+), 48 deletions(-) create mode 100644 app/pages/questions/questionsdetail.html create mode 100644 app/pages/questions/questionsdetail.scss create mode 100644 app/pages/questions/questionsdetail.ts diff --git a/app/pages/questions/questions.html b/app/pages/questions/questions.html index d681878..15766cd 100644 --- a/app/pages/questions/questions.html +++ b/app/pages/questions/questions.html @@ -6,39 +6,29 @@ + Today - - - - -

Eumir

-

Angular 2 question

-

Please teach me how to properly...

-
- - - - -

Eumir

-

Javascript question

-

What's a good way to start up a...

-
+ + + + +

Name 1

+

Angular 2 question

+

Please teach me how to properly...

+
- - + + + + +

Name 2

+

Javascript question

+

What's a good way to start up a...

+
-
+ -
- You navigated here from {{selectedItem.title}} -
diff --git a/app/pages/questions/questions.ts b/app/pages/questions/questions.ts index 4101af6..f2d9b75 100644 --- a/app/pages/questions/questions.ts +++ b/app/pages/questions/questions.ts @@ -1,5 +1,5 @@ import {IonicApp, Page, NavController, NavParams} from 'ionic-framework/ionic'; - +import {QuestionsDetail} from './questionsdetail'; @Page({ templateUrl: 'build/pages/questions/questions.html' @@ -7,26 +7,10 @@ import {IonicApp, Page, NavController, NavParams} from 'ionic-framework/ionic'; export class QuestionsPage { constructor(app: IonicApp, nav: NavController, navParams: NavParams) { this.nav = nav; - - // If we navigated to this page, we will have an item available as a nav param - this.selectedItem = navParams.get('item'); - - this.icons = ['flask', 'wifi', 'beer', 'football', 'basketball', 'paper-plane', - 'american-football', 'boat', 'bluetooth', 'build']; - - this.items = []; - for(let i = 1; i < 11; i++) { - this.items.push({ - title: 'Item ' + i, - note: 'This is item #' + i, - icon: this.icons[Math.floor(Math.random() * this.icons.length)] - }); - } } - itemTapped(event, item) { - this.nav.push(QuestionsPage, { - item: item - }) + itemTapped(item) { + this.nav.push(QuestionsDetail, { item: item }) + console.log("switch screen"); } } diff --git a/app/pages/questions/questionsdetail.html b/app/pages/questions/questionsdetail.html new file mode 100644 index 0000000..fdb3586 --- /dev/null +++ b/app/pages/questions/questionsdetail.html @@ -0,0 +1,10 @@ + + + Questions Detail + + + +Hello world + diff --git a/app/pages/questions/questionsdetail.scss b/app/pages/questions/questionsdetail.scss new file mode 100644 index 0000000..e69de29 diff --git a/app/pages/questions/questionsdetail.ts b/app/pages/questions/questionsdetail.ts new file mode 100644 index 0000000..0289e42 --- /dev/null +++ b/app/pages/questions/questionsdetail.ts @@ -0,0 +1,12 @@ +import {IonicApp, Page, NavController, NavParams} from 'ionic-framework/ionic'; + + +@Page({ + templateUrl: 'build/pages/questions/questionsdetail.html' +}) +export class QuestionsDetail { + constructor(app: IonicApp, nav: NavController, navParams: NavParams) { + + } + +} From 44926d66750e9d86f463e4d6f0fbe449cf8d0899 Mon Sep 17 00:00:00 2001 From: Eumir Gonzales Date: Tue, 5 Jan 2016 19:28:37 +0800 Subject: [PATCH 4/5] adds modal functionality, adds modal html file --- app/pages/questions/questionadd.html | 12 ++++++++++++ app/pages/questions/questions.html | 2 +- app/pages/questions/questions.ts | 24 ++++++++++++++++++++++-- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 app/pages/questions/questionadd.html diff --git a/app/pages/questions/questionadd.html b/app/pages/questions/questionadd.html new file mode 100644 index 0000000..54c4ea0 --- /dev/null +++ b/app/pages/questions/questionadd.html @@ -0,0 +1,12 @@ + + + Add a Question + + + +

I am a modal!

+ + +
diff --git a/app/pages/questions/questions.html b/app/pages/questions/questions.html index 15766cd..4010f39 100644 --- a/app/pages/questions/questions.html +++ b/app/pages/questions/questions.html @@ -30,5 +30,5 @@

Javascript question

- +
diff --git a/app/pages/questions/questions.ts b/app/pages/questions/questions.ts index f2d9b75..d586bc3 100644 --- a/app/pages/questions/questions.ts +++ b/app/pages/questions/questions.ts @@ -1,16 +1,36 @@ -import {IonicApp, Page, NavController, NavParams} from 'ionic-framework/ionic'; +import {IonicApp, Page, NavController, NavParams, Modal, Platform} from 'ionic-framework/ionic'; import {QuestionsDetail} from './questionsdetail'; @Page({ templateUrl: 'build/pages/questions/questions.html' }) export class QuestionsPage { - constructor(app: IonicApp, nav: NavController, navParams: NavParams) { + + constructor(app: IonicApp, nav: NavController, navParams: NavParams, modal: Modal) { this.nav = nav; + this.modal = modal; } itemTapped(item) { this.nav.push(QuestionsDetail, { item: item }) console.log("switch screen"); } + + openModal(item){ + this.modal.open(questionModal); + console.log("Open Modal"); + } + +} + +@Page({ + templateUrl: 'build/pages/questions/questionadd.html' +}) +class questionModal{ + + constructor(modal: Modal) { + this.nav = nav; + this.modal = Modal; + } + } From 2758db28e895b3d54de0090f8bc7f1abb007db22 Mon Sep 17 00:00:00 2001 From: Eumir Gonzales Date: Tue, 5 Jan 2016 19:55:37 +0800 Subject: [PATCH 5/5] adds comments and deleted unused code --- app/pages/questions/questionadd.html | 4 ++++ app/pages/questions/questions.html | 3 ++- app/pages/questions/questions.ts | 11 ++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/pages/questions/questionadd.html b/app/pages/questions/questionadd.html index 54c4ea0..dd382c1 100644 --- a/app/pages/questions/questionadd.html +++ b/app/pages/questions/questionadd.html @@ -1,3 +1,5 @@ + +
diff --git a/app/pages/questions/questions.html b/app/pages/questions/questions.html index 4010f39..b46e279 100644 --- a/app/pages/questions/questions.html +++ b/app/pages/questions/questions.html @@ -30,5 +30,6 @@

Javascript question

- + + diff --git a/app/pages/questions/questions.ts b/app/pages/questions/questions.ts index d586bc3..3201f94 100644 --- a/app/pages/questions/questions.ts +++ b/app/pages/questions/questions.ts @@ -11,11 +11,13 @@ export class QuestionsPage { this.modal = modal; } + //once clicked, opens up the new screen, take note of the QuestionsDetail itemTapped(item) { - this.nav.push(QuestionsDetail, { item: item }) + this.nav.push(QuestionsDetail) console.log("switch screen"); } + //opens the modal, placed here because we are still in the questions page openModal(item){ this.modal.open(questionModal); console.log("Open Modal"); @@ -23,14 +25,13 @@ export class QuestionsPage { } + +//Modal code, the templateUrl directs to the modal template @Page({ templateUrl: 'build/pages/questions/questionadd.html' }) class questionModal{ - constructor(modal: Modal) { - this.nav = nav; - this.modal = Modal; + constructor() { } - }