I am facing an issue with copying values from an employee object to a new object using Typescript. Despite my efforts, I keep encountering errors.
Here is the Typescript code snippet:
employee = [
{ "empId": "59C", "empDesc": "Software","location":"Dallas"},
{ "empId": "AMI", "empDesc": "Hardware", "location":"San Francisco"}
];
companies : any;
for (let c of this.employee) {
this.companies.push({
empDesc: c.empDesc,
empId: c.empId
})
};
console.log("Companies",this.companies);
For the complete Plunker code, visit the following link: