132
rated 0 times
[
136]
[
4]
/ answers: 1 / hits: 25092
/ 8 Years ago, mon, june 6, 2016, 12:00:00
How can I iterate over a Object using TypeScript and being able to access key and value?
My json object looks something like this:
{
clients: {
123abc: {
Forename: Simon,
Surname: Sample
},
456def: {
Forename: Charlie,
Surname: Brown
}
}
}
The clients object to be filled is made of client models looking like:
export class ClientModel {
id:string;
forename:string;
surname:string;
constructor(
private id:string,
private forename:string,
private surname:string
) {
this.id = id;
this.forename = forename;
this.surname = surname;
}
}
More From » foreach