ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278.3k

How to get values related to every loc inside location objec

Dec 29 2019 6:31 AM
I work on angular 7 
I need to loop over location and get all loc values from locations array 
  1. Locations":  
  2. [{"Loc":2937,"Fab":"Assembly"},  
  3. {"Loc":27746,"Fab":"FAB"},{"Loc":27751,"Fab":"Assembly"},  
  4. {"Loc":2931,"Fab":"Assembly"},{"Loc":27801,"Fab":"FAB"},  
  5. {"Loc":27739,"Fab":"Assembly"},{"Loc":27775,"Fab":"FAB"},  
  6. {"Loc":27789,"Fab":"FAB"}]  
Result i need to return is :
  1. result returned   
  2. 2937  
  3. 27746  
  4. 27739  
  5. 27789  
I need to store all values related to loc to array locations
2937
27746
27739
27789
to access first item
  1. this.LocationId= this.data.Locations[0]['Loc'];  
but what actually need store all values on array related to loc inside locations array?
How to do that please 
 
 

Answers (2)