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 {FormBuilder, Validators, formDirectives, ControlGroup} from 'angular2/forms'; import {List, Item, Input, ActionMenu, Modal, ModalRef, NavbarTemplate, Navbar, NavController, Content} from 'ionic/ionic'; @Component({ selector: 'ion-view' }) @View({ template: ` Cards

Forms

Forms help you gather important information from the user, like login information or content to send to your server.

Ionic comes with a variety of useful from controls, like text inputs, text areas, toggle switches, and sliders.

`, directives: [formDirectives, NavbarTemplate, Navbar, Content, List, Item, Input] }) export class FormPage { constructor() { var fb = new FormBuilder() this.form = fb.group({ email: ['', Validators.required], password: ['', Validators.required], }); } doSubmit(event) { console.log('Submitted:', this.form.value); event.preventDefault(); } }