Issue
I have 2 interfaces that have the following properties
export interface parent{
fName: string;
addresses: Array<address>;
}
export interface address{
street: string;
city: string;
state: string;
zip: string;
}
In my code I load the parent class and the address properties from JSON.
When I try to retrieve the array of "street" properties, I use the following code.
var father = parent; var streets = father.map(x=>x.street);
I am receiving an error stating father.map is not a function.
What am I doing wrong?
Solution
you need to write father.addresses.map(x=>x.street);
since the array is the addresses property
Answered By - Yidel Braver
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.