mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
31 lines
664 B
TypeScript
31 lines
664 B
TypeScript
import {Component} from 'angular2/angular2';
|
|
import {FormBuilder, Validators, ControlGroup} from 'angular2/forms';
|
|
|
|
import {IonicView} from 'ionic/ionic';
|
|
|
|
|
|
@Component({ selector: 'ion-app' })
|
|
@IonicView({
|
|
templateUrl: 'main.html'
|
|
})
|
|
class IonicApp {
|
|
constructor() {
|
|
|
|
var fb = new FormBuilder();
|
|
this.form = fb.group({
|
|
enableFun: ['', Validators.required],
|
|
enableIceCream: [false, Validators.required],
|
|
enablePizza: [true, Validators.required]
|
|
});
|
|
}
|
|
|
|
doSubmit(event) {
|
|
console.log('Submitting form', this.form.value);
|
|
event.preventDefault();
|
|
}
|
|
}
|
|
|
|
export function main(ionicBootstrap) {
|
|
ionicBootstrap(IonicApp);
|
|
}
|