Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

@import "pages/grid/grid";

@import "pages/list/list";
@import "pages/questions/questions";
4 changes: 2 additions & 2 deletions app/app.ts
Original file line number Diff line number Diff line change
@@ -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';


Expand All @@ -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 },
];

Expand Down
21 changes: 0 additions & 21 deletions app/pages/list/list.html

This file was deleted.

32 changes: 0 additions & 32 deletions app/pages/list/list.ts

This file was deleted.

16 changes: 16 additions & 0 deletions app/pages/questions/questionadd.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Modal template appears when you actually load up the modal -->

<ion-navbar *navbar>
<button menuToggle>
<icon menu></icon>
</button>
<ion-title>Add a Question</ion-title>
</ion-navbar>

<ion-content>
<h2>I am a modal!</h2>

<!-- Closing the modal does not require calling a function in your code anymore -->
<button (click)="close()">Close</button>

</ion-content>
35 changes: 35 additions & 0 deletions app/pages/questions/questions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<ion-navbar *navbar>
<button menuToggle>
<icon menu></icon>
</button>
<ion-title>Questions</ion-title>
</ion-navbar>

<ion-content>
<!-- Placeholder thumbnail list stuff -->
<ion-list>
<ion-list-header>Today</ion-list-header>

<ion-item (click)="itemTapped('selectedItem')">
<ion-thumbnail item-left>
<img src="http://placehold.it/150x150">
</ion-thumbnail>
<h2>Name 1</h2>
<H3>Angular 2 question</H3>
<p>Please teach me how to properly...</p>
</ion-item>

<ion-item (click)="itemTapped('selectedItem2')">
<ion-thumbnail item-left>
<img src="http://placehold.it/150x150">
</ion-thumbnail>
<h2>Name 2</h2>
<H3>Javascript question</H3>
<p>What's a good way to start up a...</p>
</ion-item>

</ion-list>

<!-- Opens modal, the openModal is a function -->
<button fab fab-right (click)="openModal()"><icon add></icon></button>
</ion-content>
File renamed without changes.
37 changes: 37 additions & 0 deletions app/pages/questions/questions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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, modal: Modal) {
this.nav = nav;
this.modal = modal;
}

//once clicked, opens up the new screen, take note of the QuestionsDetail
itemTapped(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");
}

}


//Modal code, the templateUrl directs to the modal template
@Page({
templateUrl: 'build/pages/questions/questionadd.html'
})
class questionModal{

constructor() {
}
}
10 changes: 10 additions & 0 deletions app/pages/questions/questionsdetail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ion-navbar *navbar>
<button menuToggle>
<icon menu></icon>
</button>
<ion-title>Questions Detail</ion-title>
</ion-navbar>

<ion-content>
Hello world
</ion-content>
Empty file.
12 changes: 12 additions & 0 deletions app/pages/questions/questionsdetail.ts
Original file line number Diff line number Diff line change
@@ -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) {

}

}