ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278.4k

when call service result res not accept : Array<any>

Dec 31 2019 8:44 PM
I work with angular 7 
I create serice as below
  1. service.ts  
  2. getLocationData(ids: Array) {      
  3.         let observableBatch = [];    
  4.         
  5.       ids.forEach((id) => {    
  6.         
  7.             observableBatch.push(    
  8.                   this.http.get('http://192.168.7.45:9200/location/_doc/'+id)    
  9.                           .map(res => res ));    
  10.         });    
  11.         
  12.         return Observable.forkJoin(observableBatch);    
  13.     }    
when i call service i get error on definition res as following :
  1. this.partDetailsService.getLocationData(this.LocationIds).subscribe(res : Array => {    
  2.           
  3. }  
my problem is res :array give me error as not defined 
so how to solve this problem
res not accept to defined as array on compile time 
so how to solve this problem
 
 
 

Answers (2)