mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
26 lines
604 B
JavaScript
26 lines
604 B
JavaScript
import {Component, View, bootstrap} from 'angular2/angular2'
|
|
import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
|
|
import {IONIC_DIRECTIVES} from 'ionic/ionic'
|
|
|
|
@Component({ selector: '[ion-app]' })
|
|
@View({
|
|
templateUrl: 'main.html',
|
|
directives: [FormDirectives].concat(IONIC_DIRECTIVES)
|
|
})
|
|
class IonicApp {
|
|
constructor() {
|
|
|
|
var fb = new FormBuilder();
|
|
this.form = fb.group({
|
|
mapStyle: ['', Validators.required]
|
|
});
|
|
}
|
|
|
|
doSubmit(event) {
|
|
console.log('Submitting form', this.form.value);
|
|
event.preventDefault();
|
|
}
|
|
}
|
|
|
|
bootstrap(IonicApp)
|