From f18fcc71a4ec81c905bf7f71f82891a773de92da Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Thu, 11 Jun 2015 15:19:38 -0500 Subject: [PATCH] Profile app --- ionic/components/app/test/profile/index.js | 54 +++++++++++++++++++++ ionic/components/app/test/profile/main.html | 53 ++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 ionic/components/app/test/profile/index.js create mode 100644 ionic/components/app/test/profile/main.html diff --git a/ionic/components/app/test/profile/index.js b/ionic/components/app/test/profile/index.js new file mode 100644 index 0000000000..c91a51a9fe --- /dev/null +++ b/ionic/components/app/test/profile/index.js @@ -0,0 +1,54 @@ +import {bind, Injector} from 'angular2/di'; +import {bootstrap, ElementRef, 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 {Modal, ModalRef, Nav, Segment, Animation, + SegmentButton, Slides, Slide, Content, Button, List, Item} from 'ionic/ionic'; +import {NavController, NavbarTemplate, NavParams, Navbar} from 'ionic/ionic'; + +@Component({ selector: 'ion-app' }) +@View({ + templateUrl: 'main.html', + directives: [formDirectives, Nav, Slides, Slide, Content, Button, List, Item, NgFor, ParallaxEffect] +}) +export class IonicApp { + constructor() { + + this.items = []; + for(let i = 0; i < 100; i++) { + this.items.push({ + title: 'Item ' + i + }) + } + } +} + +@Directive({ + selector: '[parallax]', + properties: [ + 'parallax', + 'counter' + ] +}) +export class ParallaxEffect { + constructor( + content: Content, + elementRef: ElementRef + ) { + this.domElement = elementRef.domElement; + this.scroller = this.domElement.querySelector('.scroll-content'); + this.scroller.addEventListener('scroll', (e) => { + this.counter.innerHTML = e.target.scrollTop; + }); + + setTimeout(() => { + console.log('Watching', this.parallax, this.counter); + }) + } +} + +export function main() { + bootstrap(IonicApp); +} diff --git a/ionic/components/app/test/profile/main.html b/ionic/components/app/test/profile/main.html new file mode 100644 index 0000000000..dcc2a1e781 --- /dev/null +++ b/ionic/components/app/test/profile/main.html @@ -0,0 +1,53 @@ + +
+
+
+
+ + + + {{item.title}} + + + +
+
+ + +