Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70439

Get value of select dynamically created

$
0
0

@barreola wrote:

I have the following code:

        <ion-list>
          <ion-item>
            <ion-select placeholder="País..." [formControl]="authForm.controls['country_code']">
              <ion-option *ngFor="let countries of country">
                {{countries.country_name}} ({{countries.dialling_code}})
              </ion-option>
            </ion-select>
          </ion-item>
        </ion-list>

Where country is a JSON like this:

    country = [
    { "country_code": "AL", "country_name": "Albania", "dialling_code": "+355" },
    { "country_code": "DZ", "country_name": "Algeria", "dialling_code": "+213" }];

And what I want is to get country_code property but all I get is the next object:

{firstname: "asdas", lastname: "asdas", country_code: "↵                Albania (+355)↵              ", gender: "m"}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70439

Trending Articles



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