Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to pass array of locationId to service getlocation ?

I have array of locations Id

locationArr=[40871, 60009, 38149, 40868, 43240, 15299, 53897, 40976, 38151, 23183, 38152, 78579, 23180, 40977, 23176, 39565, 40884, 15298, 38147, 40966, 39669] 
Actually I need to pass locationArr to http://192.168.7.45:9200/location/_doc/+locationArr

I need to pass array of locationId exist on locationArr to service to get GPS1 latitude and longitude for every locationId on array locationArr.

service get location by locationId for only one locationId but for array of location this is my question


What I have tried:

getLocationData(id: number) {  
console.log("server "+id)  
return this.http.get('http://192.168.7.45:9200/location/_doc/'+id);  
}  
Posted
Updated 3-Jan-20 17:22pm

1 solution

If the service only takes one, you need to call it over and over, unless you are writing the service, then change it to take an array
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900