ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 275.3k

How to return multiple values of ZCO separated by comma from array of

Jul 6 2020 9:34 PM

I work on angular 7 I face Issue : I can't separate values of ZCO by comma from array of object OriginCountry .

on component.ts

  1. OriginCountry:any[]=[];   
  2. this.OriginCountry = this.partDetailsService.currentData.OriginCountry;
  3. console.log("country origion" + JSON.stringify(this.OriginCountry) )   

result returned from OriginCountry as below :

  1. [{"CO":"zx","ZCO":"China","InfSrc":"FMD","TP":"Factory"}, 
  2. {"CO":"zy","ZCO":"Japan","InfSrc":"FMD","TP":"Factory"}]   

ON Component.html

  1. <div *ngFor="let country of OriginCountry">     
  2. {{country.ZCO}}     
  3. </div>    

Expected Result of ZCO as :

Japan,China 

Answers (1)