diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 4bb6a8d..0b26f20 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -19,15 +19,16 @@ export class MyApp {
rootPage: any = LoginPage;
- pages: Array<{title: string, component: any}>;
+ pages: Array<{title: string, component: any, params: Object}>;
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, private storage: Storage) {
this.initializeApp();
// used for an example of ngFor and navigation
this.pages = [
- { title: 'Global Stream', component: StreamPage },
- { title: 'List', component: ListPage },
+ { title: 'Global Stream', component: StreamPage, params: {stream: 'global'} },
+ { title: 'Personal Stream', component: StreamPage, params: {stream: 'personal'} },
+ { title: 'List', component: ListPage , params: {}},
];
}
@@ -37,7 +38,7 @@ export class MyApp {
this.storage.get('token').then((val) => {
if (val.length > 1) {
pnut.token = val;
- this.nav.setRoot(StreamPage);
+ this.nav.setRoot(StreamPage, {stream: 'global'});
}
}).catch(err => {
console.log('ERROR: ' + err);
@@ -54,7 +55,7 @@ export class MyApp {
openPage(page) {
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
- this.nav.setRoot(page.component);
+ this.nav.setRoot(page.component, page.params);
}
}
diff --git a/src/pages/stream/stream.html b/src/pages/stream/stream.html
index 45904bc..1002ea9 100644
--- a/src/pages/stream/stream.html
+++ b/src/pages/stream/stream.html
@@ -7,7 +7,10 @@
{{post.content.text}}
+{{ post.is_deleted ? '{post deleted}' : post.content.text }}
diff --git a/src/pages/stream/stream.ts b/src/pages/stream/stream.ts index e250aca..7feb046 100644 --- a/src/pages/stream/stream.ts +++ b/src/pages/stream/stream.ts @@ -16,10 +16,21 @@ import * as pnut from 'pnut-butter'; }) export class StreamPage { + title: string; posts: Array