If passing parameters to the url is required, you can use HttpParams 
<https://angular.io/api/common/http/HttpParams>.
If not, I suggest you use RxJS BehaviorSubject 
<https://xgrommx.github.io/rx-book/content/subjects/behavior_subject/index.html>
.
Note: The URL of browser has max length is 2048 characters.



On Monday, December 30, 2019 at 9:23:37 AM UTC+9, ahmed elbarbary wrote:
>
> *How to pass array of locationId to service to get latitude and longitude 
> ?*
>
>
> *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 
> <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*
>
>
> getLocationData(id: number) {  
>
>
>
> console.log("server "+id)  
>
> return this.http.get('http://192.168.7.45:9200/location/_doc/'+id);  
>
> }  
>
>
>
>
>
>
> *calling service*
>
>
>
>
>
> this.partDetailsService.getLocationData(this.LocationId).subscribe(res => 
> {          
>
>          this.dataLocation = res['_source']['GPS1'];     
>
>          var loc = this.dataLocation.split(',');      
>
>          this.lat = loc[0].trim();    
>
>          this.lng = loc[1].trim(); 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/3a1d1dd8-2bdb-4483-86d0-66b2a268eb8d%40googlegroups.com.

Reply via email to