I am trying to figure out how to transpose response into a interface i created for storage.
i.e.
interface TestInterface {
name: string,
count: number
}
http.get("localhost:8088/api/getdata")
.map(res => res.json()
.subscribe(
(data) => {
// transpose the response into array of TestInterface
});
The response returns a array of objects in following format:
[
{
"Id": "54d130ce-0812-e711-b861-f01faf23929d",
"Name": "First Name Attempt",
"Description": "asd",
"Count": 5
},
{
"Id": "6f08ca4a-0d12-e711-b861-f01faf23929d",
"Name": "Second Attempt",
"Description": "One Site",
"Count": 3
}
]