mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(segment): working
This commit is contained in:
@ -5,12 +5,11 @@ import {App} from 'ionic/ionic';
|
||||
|
||||
@App({
|
||||
templateUrl: 'main.html',
|
||||
appInjector: [FormBuilder],
|
||||
bindings: [FormBuilder],
|
||||
directives: [FORM_DIRECTIVES]
|
||||
})
|
||||
class IonicApp {
|
||||
class MyApp {
|
||||
constructor(fb: FormBuilder) {
|
||||
|
||||
this.myForm = fb.group({
|
||||
mapStyle: ['hybrid', Validators.required]
|
||||
});
|
||||
@ -18,7 +17,7 @@ class IonicApp {
|
||||
}
|
||||
|
||||
doSubmit(event) {
|
||||
console.log('Submitting form', this.form.value);
|
||||
console.log('Submitting form', this.myForm.value);
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
<ion-content padding>
|
||||
<form (submit)="doSubmit($event)" [ng-form-model]="myForm">
|
||||
<ion-segment ng-control="mapStyle">
|
||||
<ion-segment-button value="standard" button>
|
||||
<ion-segment ng-control="mapStyle" danger>
|
||||
<ion-segment-button value="standard">
|
||||
Standard
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="hybrid" button>
|
||||
<ion-segment-button value="hybrid">
|
||||
Hybrid
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="sat" button>
|
||||
<ion-segment-button value="sat">
|
||||
Satellite
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
|
Reference in New Issue
Block a user