import {DynamicComponentLoader, ElementRef, ComponentRef, onDestroy, DomRenderer} from 'angular2/angular2';
import {bind, Injector} from 'angular2/di';
import {bootstrap} from 'angular2/angular2'
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
import {View} from 'angular2/src/core/annotations_impl/view';
import {Parent, Ancestor} from 'angular2/src/core/annotations_impl/visibility';
import {Content, List, Item, Button, Modal, ModalRef} from 'ionic/ionic';
import {Nav} from 'ionic/ionic';
import {NavController, NavParams, NavbarTemplate, Navbar} from 'ionic/ionic';
@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html',
directives: [Content, List, Item, Button]
})
class IonicApp {
constructor(loader: DynamicComponentLoader, injector: Injector, domRenderer: DomRenderer, elementRef: ElementRef) {
this.loader = loader;
this.domRenderer = domRenderer;
this.elementRef = elementRef;
this.injector = injector;
console.log('IonicApp Start', loader, domRenderer, elementRef);
}
openModal() {
console.log('Opening modal');
Modal.show(ContactModal, this.loader, this.injector, this.domRenderer, this.elementRef);
}
}
@Component({
selector: 'contact-modal'
})
@View({
//template: '
First Page: {{ val }}
`, directives: [Nav, Button, Content] }) export class ContactModal { constructor(modalRef: ModalRef) { this.initial = ModalFirstPage; this.modalRef = modalRef; } close() { console.log('Closing modal'); this.modalRef.close(); } } @Component({selector: 'ion-view'}) @View({ template: `
First Page: {{ val }}