mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00

Updated the API docs for segment to include change & click, and updated some of the function descriptions, removed an unused function. Added the change & click events to the test case.
36 lines
767 B
TypeScript
36 lines
767 B
TypeScript
import {FORM_DIRECTIVES, FormBuilder, Validators, Control, ControlGroup} from 'angular2/common';
|
|
|
|
import {App, IonicApp} from 'ionic/ionic';
|
|
|
|
|
|
@App({
|
|
templateUrl: 'main.html',
|
|
providers: [FormBuilder],
|
|
directives: [FORM_DIRECTIVES]
|
|
})
|
|
class MyApp {
|
|
constructor(fb: FormBuilder, app: IonicApp) {
|
|
this.app = app;
|
|
this.myForm = fb.group({
|
|
mapStyle: ['hybrid', Validators.required]
|
|
});
|
|
|
|
this.relationship = 'enemies';
|
|
this.modelStyle = 'B';
|
|
this.appType = 'free';
|
|
}
|
|
|
|
onSegmentChanged(value) {
|
|
console.log("Segment changed to", value);
|
|
}
|
|
|
|
onSegmentClicked(value) {
|
|
console.log("Segment clicked", value);
|
|
}
|
|
|
|
doSubmit(event) {
|
|
console.log('Submitting form', this.myForm.value);
|
|
event.preventDefault();
|
|
}
|
|
}
|