Quantcast
Viewing all articles
Browse latest Browse all 49225

Ionic selectable value from json file

Hi I’m trying to get ion-selectable value from json file
my code:

this.http.get(‘assets/airport_volume_airport_locations.json’).map(res => res.json()).subscribe(data => {

this.airports = data;

});

for (let index = 0; index < this.airports.length; index++) {

this.port=[{name:this.airports[index].Orig,value:this.airports[index].Orig},] ;
}
my json file:

[

{

“Orig”: “HEA”,

“Name”: “Herat”,

“TotalSeats”: 22041.971,

“Country Name”: “Afghanistan”,

“Airport1Latitude”: 34.20690155,

“Airport1Longitude”: 62.22669983

},

{

“Orig”: “JAA”,

“Name”: “Jalalabad”,

“TotalSeats”: 6343.512,

“Country Name”: “Afghanistan”,

“Airport1Latitude”: 34.40000153,

“Airport1Longitude”: 70.5

},

{

“Orig”: “KBL”,

“Name”: “Kabul International”,

“TotalSeats”: 1016196.825,

“Country Name”: “Afghanistan”,

“Airport1Latitude”: 34.56389999,

“Airport1Longitude”: 69.21389771

},

{

“Orig”: “KDH”,

“Name”: “Kandahar International”,

“TotalSeats”: 39924.262,

“Country Name”: “Afghanistan”,

“Airport1Latitude”: 31.50690079,

“Airport1Longitude”: 65.84750366

},

{

“Orig”: “MZR”,

“Name”: “Mazar-e-Sharif”,

“TotalSeats”: 58326.513,

“Country Name”: “Afghanistan”,

“Airport1Latitude”: 36.70420075,

“Airport1Longitude”: 67.20829773

},

{

“Orig”: “OAI”,

“Name”: “Bagram Airport”,

“TotalSeats”: 18016.614,

“Country Name”: “Afghanistan”,

“Airport1Latitude”: 34.94639969,

“Airport1Longitude”: 69.26499939

}, …

but the result is empty like this
Image may be NSFW.
Clik here to view.
sel

any help

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49225

Trending Articles