From abcd8af221208d2bbabe87c606656408b55cfd94 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Wed, 10 Jun 2015 15:10:44 -0500 Subject: [PATCH] Snapcat --- ionic/components/app/test/snapcat/index.js | 58 ++++++++++++++++++++- ionic/components/app/test/snapcat/main.html | 4 +- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/ionic/components/app/test/snapcat/index.js b/ionic/components/app/test/snapcat/index.js index 25c115d290..2f18209e56 100644 --- a/ionic/components/app/test/snapcat/index.js +++ b/ionic/components/app/test/snapcat/index.js @@ -1,9 +1,11 @@ +import {DynamicComponentLoader, ElementRef, ComponentRef, onDestroy, DomRenderer} from 'angular2/angular2'; +import {bind, Injector} from 'angular2/di'; 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 {Modal, ModalRef, Nav, Segment, SegmentButton, Slides, Slide, Content, Button, List, Item} from 'ionic/ionic'; import {NavController, NavbarTemplate, NavParams, Navbar} from 'ionic/ionic'; @Component({ selector: 'ion-view' }) @@ -74,8 +76,60 @@ export class FeedPage { directives: [formDirectives, Nav, Slides, Slide, Content, Button, List, Item] }) export class IonicApp { - constructor() { + constructor(loader: DynamicComponentLoader, injector: Injector, domRenderer: DomRenderer, elementRef: ElementRef) { this.feedPage = FeedPage + + this.loader = loader; + this.domRenderer = domRenderer; + this.elementRef = elementRef; + this.injector = injector; + + console.log('IonicApp Start', loader, domRenderer, elementRef); + } + + openHeart() { + console.log('Heart'); + //Modal.show(HeartModal, this.loader, this.injector, this.domRenderer, this.elementRef); + } + + openGear() { + console.log('Gear'); + + Modal.show(SettingsModal, this.loader, this.injector, this.domRenderer, this.elementRef); + } +} + +@Component({ + selector: 'settings-modal' +}) +@View({ + template: '', + directives: [Nav, Button, Content] +}) +export class SettingsModal { + constructor(modalRef: ModalRef) { + this.modalRef = modalRef; + } + close() { + console.log('Closing modal'); + this.modalRef.close(); + } +} + +@Component({ + selector: 'heart-modal' +}) +@View({ + template: '', + directives: [Nav, Button, Content] +}) +export class HeartModal { + constructor(modalRef: ModalRef) { + this.modalRef = modalRef; + } + close() { + console.log('Closing modal'); + this.modalRef.close(); } } diff --git a/ionic/components/app/test/snapcat/main.html b/ionic/components/app/test/snapcat/main.html index cca2f7986d..1fb70ddad0 100644 --- a/ionic/components/app/test/snapcat/main.html +++ b/ionic/components/app/test/snapcat/main.html @@ -5,9 +5,9 @@ - + secret - +