Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49313

Get value from option

$
0
0

@almufadhdhal wrote:

this is my view

<ion-item>
        <ion-label floating style="color:red">Shipping Address</ion-label>
        <ion-select [(ngModel)]="data.office_code" name="office_code" ([ngModel])="selectedItem" (ionChange)="onItemSelection(selection)">
          <ion-option *ngFor="let data of ofcode" [value]="data.office_code"> {{data.title_address}}
          </ion-option>

        </ion-select>

      </ion-item>

this is my controller

public onItemSelection(selection) {
    if ( selection != undefined) {
      console.log(selection);
       console.log('bbbbbbb');
       console.log(this.ofcode);

    } else {

      console.log(this.selectedItem);
       console.log('lalalalala');
        console.log(this.ofcode);
        /*console.log(selection.data.office_code);*/
    }

  }

how can i get value from selected item?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>