Files
Brandy Carney 0f57b1f64f feat(segment): added change event to segment which emits the value
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.
2015-12-16 15:43:38 -05:00

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();
}
}