mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
27 lines
567 B
TypeScript
27 lines
567 B
TypeScript
import {FORM_DIRECTIVES, FormBuilder, Validators, Control, ControlGroup} from 'angular2/common';
|
|
|
|
import {App} from 'ionic/ionic';
|
|
|
|
|
|
@App({
|
|
templateUrl: 'main.html',
|
|
providers: [FormBuilder],
|
|
directives: [FORM_DIRECTIVES]
|
|
})
|
|
class MyApp {
|
|
constructor(fb: FormBuilder) {
|
|
this.myForm = fb.group({
|
|
mapStyle: ['hybrid', Validators.required]
|
|
});
|
|
|
|
this.relationship = 'enemies';
|
|
this.modelStyle = 'B';
|
|
this.appType = 'free';
|
|
}
|
|
|
|
doSubmit(event) {
|
|
console.log('Submitting form', this.myForm.value);
|
|
event.preventDefault();
|
|
}
|
|
}
|