How can I get these values from the ion select?


How do I get the values of the client firstname and surname when the user selects the client id in the ion select? I get the clientId but I want the names themselves.

            <ion-label stacked>Client</ion-label>
            <ion-select formControlName="clientId">
                <ion-option *ngFor="let client of clientList | async" [value]="client.clientId">{{client.firstName}} {{client.surName}}</ion-option>


wouldn’t you bind on client, instead of client.clientId


then u would have access to all the client attributes


I can get all the client attributes inside the ion option but anywhere else. I need to pass the clientID, firstname and surname to a set method in a provider.


sorry, i don’t understand your reply.

u asked how to get the values when the option is selected.

so, you would pass back the client structure (instead of just one field), and in the code behind extract the important fields.


I want the user to select a client from the list and then to capture the clientID, clientFirstName and clientSurname in order to save it in my firestore database.

export class CreateSessionPage {

  public createSessionForm: FormGroup;
  public clientList: Observable<client[]>;

  constructor(public navCtrl: NavController, public loadingCtrl: LoadingController,
    public alertCtrl: AlertController, public clientPro: ClientsProvider, public sessionPro: SessionsProvider,
    formBuilder: FormBuilder) {

      this.createSessionForm ={
        sessionDate: ['', Validators.required],
        sessionTime: ['', Validators.required],
        clientId: ['', Validators.required]


  ionViewDidLoad() {
    this.clientList = this.clientPro.getClientList().valueChanges();

  createSession(): void {
    const loading: Loading = this.loadingCtrl.create();
    const sessionDate = this.createSessionForm.value.sessionDate;
    const sessionTime = this.createSessionForm.value.sessionTime;
    const clientId = this.createSessionForm.value.clientId;


right, so


would be ‘client’