import {NgFor, DynamicComponentLoader, Injector, DomRenderer, ElementRef} from 'angular2/angular2'; import {Ancestor} from 'angular2/src/core/annotations_impl/visibility'; import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations'; import {View} from 'angular2/src/core/annotations_impl/view'; import {ActionMenu, Modal, ModalRef, NavbarTemplate, Navbar, NavController, Button, Content} from 'ionic/ionic'; @Component({ selector: 'ion-view' }) @View({ template: ` Modal

Modal

Modals are entire views that slide in off screen.

Modals make it easy to open a new "context" for the user, without taking them out of the current context. For example, clicking the "compose" button on a mail app might slide up a Compose modal.

`, directives: [NavbarTemplate, Navbar, Content, Button] }) export class ModalPage { constructor(nav: NavController, loader: DynamicComponentLoader, injector: Injector, domRenderer: DomRenderer, elementRef: ElementRef) { this.loader = loader; this.domRenderer = domRenderer; this.elementRef = elementRef; this.injector = injector; this.nav = nav; window.nav = nav; console.log('IonicApp Start', loader, domRenderer, elementRef); } openModal() { console.log('Opening modal'); Modal.show(MyModal, this.loader, this.injector, this.domRenderer, this.elementRef); } openMenu() { console.log('Opening Modal') } } @Component({ selector: 'my-modal' }) @View({ template: '', directives: [Button, Content] }) export class MyModal { constructor(modalRef: ModalRef) { //this.initial = ModalFirstPage; this.modalRef = modalRef; } close() { console.log('Closing modal'); this.modalRef.close(); } }