remove unused components
This commit is contained in:
parent
7b365f0c7c
commit
83af41310e
11 changed files with 2 additions and 190 deletions
|
@ -4,8 +4,6 @@ import { StatusBar } from '@ionic-native/status-bar';
|
||||||
import { SplashScreen } from '@ionic-native/splash-screen';
|
import { SplashScreen } from '@ionic-native/splash-screen';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
// import { HomePage } from '../pages/home/home';
|
|
||||||
import { ListPage } from '../pages/list/list';
|
|
||||||
import { LoginPage } from '../pages/login/login';
|
import { LoginPage } from '../pages/login/login';
|
||||||
import { StreamPage } from '../pages/stream/stream';
|
import { StreamPage } from '../pages/stream/stream';
|
||||||
|
|
||||||
|
@ -26,9 +24,8 @@ export class MyApp {
|
||||||
|
|
||||||
// used for an example of ngFor and navigation
|
// used for an example of ngFor and navigation
|
||||||
this.pages = [
|
this.pages = [
|
||||||
{ title: 'Global Stream', component: StreamPage, params: {stream: 'global'} },
|
|
||||||
{ title: 'Personal Stream', component: StreamPage, params: {stream: 'personal'} },
|
{ title: 'Personal Stream', component: StreamPage, params: {stream: 'personal'} },
|
||||||
{ title: 'List', component: ListPage , params: {}},
|
{ title: 'Global Stream', component: StreamPage, params: {stream: 'global'} },
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +35,7 @@ export class MyApp {
|
||||||
this.storage.get('token').then((val) => {
|
this.storage.get('token').then((val) => {
|
||||||
if (val.length > 1) {
|
if (val.length > 1) {
|
||||||
pnut.token = val;
|
pnut.token = val;
|
||||||
this.nav.setRoot(StreamPage, {stream: 'global'});
|
this.nav.setRoot(StreamPage, {stream: 'personal'});
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log('ERROR: ' + err);
|
console.log('ERROR: ' + err);
|
||||||
|
|
|
@ -3,8 +3,6 @@ import { ErrorHandler, NgModule } from '@angular/core';
|
||||||
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
|
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
|
||||||
|
|
||||||
import { MyApp } from './app.component';
|
import { MyApp } from './app.component';
|
||||||
import { HomePage } from '../pages/home/home';
|
|
||||||
import { ListPage } from '../pages/list/list';
|
|
||||||
import { LoginPage } from '../pages/login/login';
|
import { LoginPage } from '../pages/login/login';
|
||||||
import { StreamPage, NewPostModal } from '../pages/stream/stream';
|
import { StreamPage, NewPostModal } from '../pages/stream/stream';
|
||||||
import { ThreadPage } from '../pages/thread/thread';
|
import { ThreadPage } from '../pages/thread/thread';
|
||||||
|
@ -17,8 +15,6 @@ import { TimeagoPipe } from '../pipes/timeago/timeago';
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
MyApp,
|
MyApp,
|
||||||
HomePage,
|
|
||||||
ListPage,
|
|
||||||
LoginPage,
|
LoginPage,
|
||||||
StreamPage,
|
StreamPage,
|
||||||
ThreadPage,
|
ThreadPage,
|
||||||
|
@ -33,8 +29,6 @@ import { TimeagoPipe } from '../pipes/timeago/timeago';
|
||||||
bootstrap: [IonicApp],
|
bootstrap: [IonicApp],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
MyApp,
|
MyApp,
|
||||||
HomePage,
|
|
||||||
ListPage,
|
|
||||||
LoginPage,
|
LoginPage,
|
||||||
StreamPage,
|
StreamPage,
|
||||||
ThreadPage,
|
ThreadPage,
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
<ion-header>
|
|
||||||
<ion-navbar>
|
|
||||||
<button ion-button menuToggle>
|
|
||||||
<ion-icon name="menu"></ion-icon>
|
|
||||||
</button>
|
|
||||||
<ion-title>Home</ion-title>
|
|
||||||
</ion-navbar>
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
<ion-content padding>
|
|
||||||
<h3>Ionic Menu Starter</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
If you get lost, the <a href="http://ionicframework.com/docs/v2">docs</a> will show you the way.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<button ion-button secondary menuToggle>Toggle Menu</button>
|
|
||||||
<button ion-button secondary (click)="fetchGlobal()">Test</button>
|
|
||||||
</ion-content>
|
|
|
@ -1,3 +0,0 @@
|
||||||
page-home {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
import { Component } from '@angular/core';
|
|
||||||
import { NavController } from 'ionic-angular';
|
|
||||||
import { Storage } from '@ionic/storage';
|
|
||||||
|
|
||||||
import * as pnut from 'pnut-butter';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'page-home',
|
|
||||||
templateUrl: 'home.html'
|
|
||||||
})
|
|
||||||
export class HomePage {
|
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, private storage: Storage) {
|
|
||||||
console.log('*** Created HomePage ***');
|
|
||||||
this.fetchMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
fetchGlobal() {
|
|
||||||
console.log('.... going to fetch global maybe ....');
|
|
||||||
pnut.global().then(res => {
|
|
||||||
console.log(res);
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
fetchMe() {
|
|
||||||
pnut.user('me').then(res => {
|
|
||||||
console.log('RESULT: ' + JSON.stringify(res));
|
|
||||||
}).catch( err => {
|
|
||||||
console.log('ERROR: ' + JSON.stringify(err));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
<ion-header>
|
|
||||||
<ion-navbar>
|
|
||||||
<button ion-button menuToggle>
|
|
||||||
<ion-icon name="menu"></ion-icon>
|
|
||||||
</button>
|
|
||||||
<ion-title>List</ion-title>
|
|
||||||
</ion-navbar>
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
<ion-content>
|
|
||||||
<ion-list>
|
|
||||||
<button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">
|
|
||||||
<ion-icon [name]="item.icon" item-left></ion-icon>
|
|
||||||
{{item.title}}
|
|
||||||
<div class="item-note" item-right>
|
|
||||||
{{item.note}}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</ion-list>
|
|
||||||
<div *ngIf="selectedItem" padding>
|
|
||||||
You navigated here from <b>{{selectedItem.title}}</b>
|
|
||||||
</div>
|
|
||||||
</ion-content>
|
|
|
@ -1,3 +0,0 @@
|
||||||
page-list {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
import { Component } from '@angular/core';
|
|
||||||
import { NavController, NavParams } from 'ionic-angular';
|
|
||||||
|
|
||||||
import * as pnut from 'pnut-butter';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'page-list',
|
|
||||||
templateUrl: 'list.html'
|
|
||||||
})
|
|
||||||
export class ListPage {
|
|
||||||
selectedItem: any;
|
|
||||||
icons: string[];
|
|
||||||
items: Array<{title: string, note: string, icon: string}>;
|
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
|
||||||
console.log('*** created ListPage ***');
|
|
||||||
pnut.user('me').then(res => {
|
|
||||||
console.log('RESULT: ' + JSON.stringify(res));
|
|
||||||
}).catch( err => {
|
|
||||||
console.log('ERROR: ' + JSON.stringify(err));
|
|
||||||
});
|
|
||||||
// If we navigated to this page, we will have an item available as a nav param
|
|
||||||
this.selectedItem = navParams.get('item');
|
|
||||||
|
|
||||||
// Let's populate this page with some filler content for funzies
|
|
||||||
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) {
|
|
||||||
// That's right, we're pushing to ourselves!
|
|
||||||
this.navCtrl.push(ListPage, {
|
|
||||||
item: item
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
<!--
|
|
||||||
Generated template for the PostDetailsPage page.
|
|
||||||
|
|
||||||
See http://ionicframework.com/docs/components/#navigation for more info on
|
|
||||||
Ionic pages and navigation.
|
|
||||||
-->
|
|
||||||
<ion-header>
|
|
||||||
|
|
||||||
<ion-navbar>
|
|
||||||
<ion-title>postDetails</ion-title>
|
|
||||||
</ion-navbar>
|
|
||||||
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
|
|
||||||
<ion-content>
|
|
||||||
<!-- <img src="assets/img/headers/{{parkInfo.image}}"> -->
|
|
||||||
<!-- <h1 padding>{{parkInfo.name}}</h1> -->
|
|
||||||
<ion-card>
|
|
||||||
<ion-card-header>Post {{ postData.id }}</ion-card-header>
|
|
||||||
<ion-card-content>
|
|
||||||
<h1>{{ postData.user.username }}</h1>
|
|
||||||
<p>{{ postData.content.text }}</p>
|
|
||||||
</ion-card-content>
|
|
||||||
</ion-card>
|
|
||||||
</ion-content>
|
|
|
@ -1,3 +0,0 @@
|
||||||
page-post-details {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
import { Component } from '@angular/core';
|
|
||||||
import { NavController, NavParams } from 'ionic-angular';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generated class for the PostDetailsPage page.
|
|
||||||
*
|
|
||||||
* See http://ionicframework.com/docs/components/#navigation for more info
|
|
||||||
* on Ionic pages and navigation.
|
|
||||||
*/
|
|
||||||
@Component({
|
|
||||||
selector: 'page-post-details',
|
|
||||||
templateUrl: 'post-details.html',
|
|
||||||
})
|
|
||||||
export class PostDetailsPage {
|
|
||||||
|
|
||||||
postData: Object;
|
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
|
||||||
this.postData = navParams.data.post;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Reference in a new issue