When I get the data from the json I first create a class and define all the variables I get in json for strict data type like my json file is
{"fname":"Mark","lname":"jhony"}
so in angular i make the class like this
export class user{
fname: string;
lname : string;
}
I am confuse how to make the class for the following json data
{"fname":"Mark","lname":"jhony",
"parcels":[
{
"parcelId":123,
"parcelName :"asd",
"parcelItems:[
{
"itemId":2,
"itemName":"perfume"
},
{
"itemId":4,
"itemName":"soap"
}
]
]}
I tried to add array in the class but not getting what would be the best way to handle it in angularjs.