import {FormBuilder, Validators, Control, ControlGroup} from 'angular2/angular2'; import {IonicView} from 'ionic/ionic'; @IonicView({ template: ` Segment

Segment

A segment is a radio-style filter bar to let the user toggle between multiple, exclusive options.

Segments are useful for quick filtering, like switching the the map display between street, hybrid, and satellite.

Standard Hybrid Satellite
Map mode: {{form.controls.mapStyle.value}}

Standard

Hybrid

Satellite!!

` }) export class SegmentPage { constructor() { /* var fb = new FormBuilder(); this.form = fb.group({ mapStyle: ['hybrid', Validators.required] }); */ this.mapStyle = new Control("hybrid", Validators.required); this.form = new ControlGroup({ "mapStyle": this.mapStyle }); } }