A simple ion picker, easily customizable.
1) > Ionic 2.X
Copy src to your project.
1.Import MultiPickerModule to your app/module.
import { IonPicker } from '../components/ion-picker/ion-picker';
...
@NgModule({
declarations: [
MyApp,
IonPicker
],
imports: [
BrowserModule,
HttpModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
IonPicker
],
providers: providers()
})
export class AppModule {}
2.Initialize picker data.
public items: Array<any> = [{
icon: 'logo-android',
text: 'Android',
value: 'android',
}, {
icon: 'logo-angular',
text: 'Angular',
value: 'angular',
}, {
icon: 'logo-apple',
text: 'Apple',
value: 'apple',
}];
3.Insert ion-picker into form.
<ion-item>
<ion-picker formControlName="option" [items]="items" required></ion-picker>
</ion-item>
MIT