From dd208207a7c022208496ed09a10e2c8bfb72d0df Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Tue, 9 Jun 2015 14:46:06 -0500 Subject: [PATCH] Detail and post page --- ionic/components/app/test/snapcat/detail.html | 13 ++++ ionic/components/app/test/snapcat/feed.html | 14 ++++ ionic/components/app/test/snapcat/index.js | 76 ++++++++++++++++--- ionic/components/app/test/snapcat/main.html | 76 ++----------------- ionic/platform/platform.js | 2 +- 5 files changed, 99 insertions(+), 82 deletions(-) create mode 100644 ionic/components/app/test/snapcat/detail.html create mode 100644 ionic/components/app/test/snapcat/feed.html diff --git a/ionic/components/app/test/snapcat/detail.html b/ionic/components/app/test/snapcat/detail.html new file mode 100644 index 0000000000..5aef7b90d2 --- /dev/null +++ b/ionic/components/app/test/snapcat/detail.html @@ -0,0 +1,13 @@ +Post + + +
+
+ {{post.text}} +
+ + +
+
diff --git a/ionic/components/app/test/snapcat/feed.html b/ionic/components/app/test/snapcat/feed.html new file mode 100644 index 0000000000..5221e98d57 --- /dev/null +++ b/ionic/components/app/test/snapcat/feed.html @@ -0,0 +1,14 @@ +Feed + + + +
+
+ {{post.text}} +
+ + +
+
diff --git a/ionic/components/app/test/snapcat/index.js b/ionic/components/app/test/snapcat/index.js index 259fca2340..25c115d290 100644 --- a/ionic/components/app/test/snapcat/index.js +++ b/ionic/components/app/test/snapcat/index.js @@ -1,27 +1,81 @@ -import {bootstrap} from 'angular2/angular2' +import {bootstrap, NgFor} from 'angular2/angular2' import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; import {View} from 'angular2/src/core/annotations_impl/view'; import {FormBuilder, Control, ControlGroup, Validators, formDirectives} from 'angular2/forms'; import {Nav, Segment, SegmentButton, Slides, Slide, Content, Button, List, Item} from 'ionic/ionic'; +import {NavController, NavbarTemplate, NavParams, Navbar} from 'ionic/ionic'; -@Component({ selector: 'ion-app' }) +@Component({ selector: 'ion-view' }) @View({ - templateUrl: 'main.html', - directives: [formDirectives, Nav, Segment, SegmentButton, Slides, Slide, Content, Button, List, Item] + templateUrl: 'detail.html', + directives: [formDirectives, NavbarTemplate, Navbar, Content, Button, List, Item] }) -export class IonicApp { - constructor() { +export class DetailPage { + constructor(params: NavParams) { + this.post = params.post; + } +} + +@Component({ selector: 'ion-view' }) +@View({ + templateUrl: 'feed.html', + directives: [formDirectives, NgFor, NavbarTemplate, Navbar, Segment, SegmentButton, Content, Button, List, Item] +}) +export class FeedPage { + constructor(nav: NavController) { + this.nav = nav; this.filterForm = new ControlGroup({ filterControl: new Control("") }); - /* - var fb = new FormBuilder(); - this.form = fb.group({ - filter: ['new'] + + this.posts = [ + { + text: 'I tried to keep both arts alive, but the camera won. I found that while the camera does not express the soul, perhaps a photograph can!', + image: 'http://ionic-io-assets.s3.amazonaws.com/images/p.jpg', + day: 5 + }, + { + text: 'It is good to realize that if love and peace can prevail on earth, and if we can teach our children to honor nature\'s gifts, the joys and beauties of the outdoors will be here forever.', + image: 'http://ionic-io-assets.s3.amazonaws.com/images/p1.png', + day: 6 + }, + { + text: 'I see humanity now as one vast plant, needing for its highest fulfillment only love, the natural blessings of the great outdoors, and intelligent crossing and selection.', + image: 'http://ionic-io-assets.s3.amazonaws.com/images/p2.png', + day: 7 + }, + { + text: 'You must not lose faith in humanity. Humanity is an ocean; if a few drops of the ocean are dirty, the ocean does not become dirty.', + image: 'http://ionic-io-assets.s3.amazonaws.com/images/p3.png', + day: 7 + }, + { + text: 'Keep close to Nature\'s heart... and break clear away, once in awhile, and climb a mountain or spend a week in the woods. Wash your spirit clean.', + image: 'http://ionic-io-assets.s3.amazonaws.com/images/p4.png', + day: 8 + } + ]; + } + + postClicked(event, post) { + console.log('Post clicked'); + this.nav.push(DetailPage, { + post: post }); - */ + event.preventDefault(); + } +} + +@Component({ selector: 'ion-app' }) +@View({ + templateUrl: 'main.html', + directives: [formDirectives, Nav, Slides, Slide, Content, Button, List, Item] +}) +export class IonicApp { + constructor() { + this.feedPage = FeedPage } } diff --git a/ionic/components/app/test/snapcat/main.html b/ionic/components/app/test/snapcat/main.html index ff1f9777d7..cca2f7986d 100644 --- a/ionic/components/app/test/snapcat/main.html +++ b/ionic/components/app/test/snapcat/main.html @@ -1,5 +1,7 @@ - + + + @@ -20,78 +22,12 @@ + + - - -
- feed - -
-
- - - -
-
- I tried to keep both arts alive, but the camera won. I found that while the camera does not express the soul, perhaps a photograph can! -
- - -
- -
-
- It is good to realize that if love and peace can prevail on earth, and if we can teach our children to honor nature's gifts, the joys and beauties of the outdoors will be here forever. -
- - -
- -
-
- I see humanity now as one vast plant, needing for its highest fulfillment only love, the natural blessings of the great outdoors, and intelligent crossing and selection. -
- - -
- -
-
- You must not lose faith in humanity. Humanity is an ocean; if a few drops of the ocean are dirty, the ocean does not become dirty. -
- - -
- -
-
- Keep close to Nature's heart... and break clear away, once in awhile, and climb a mountain or spend a week in the woods. Wash your spirit clean. -
- - -
-
+
diff --git a/ionic/platform/platform.js b/ionic/platform/platform.js index 269e8e4ca5..9a11f5e966 100644 --- a/ionic/platform/platform.js +++ b/ionic/platform/platform.js @@ -127,7 +127,7 @@ Platform.register({ } }, run() { - //Tap.run(); + Tap.run(); } });