ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278.2k

How to return code for country ?

Jul 9 2020 7:04 AM
How to return code for country on angular 7 ?
 
I work on angular 7 app I face Issue I cannot  display country code for country meaning
 
I already return country on ZCO  as India , egypt,unitedstates and it working
 
but I cannot display code for country as IN,eg,us 
 
ts compoent 
  1.  this.OriginCountry= this.partDetailsService.currentData.OriginCountry;  
  2.     this.OriginCountry.forEach(e => {  
  3.               e.code=getCode(e.ZCO);  
  4.       
  5.             });  
  6.   
  7. console.log("country origion" + JSON.stringify(this.OriginCountry) )  
 html component
  1. <div *ngFor="let country of  OriginCountry" >  
  2.               {{country.ZCO}}  
  3.               <img class="mr-05" src="http://part.z2data.com/assets/img/flags/{{country.code}}.png">  
  4.              
  5.           </div>  
 only I need to get code for country 
 
I already have country and represented by ZCO
 
but code as us,in cannot return 
 
are there are any package or function do that on angular 7
 
please help me  
 
ZCO represent country as egypt, Unitedstates,India 
 

Answers (3)