I am trying to create dynamic scope variable.
Here is the json object:
{
"status": true,
"res": {
"call": [
{
"percent": 100,
"name": "150+"
}
],
"stores": [
{
"percent": 100,
"name": "150+"
}
],
"web": [
{
"percent": 21,
"name": "120-150"
},
{
"percent": 79,
"name": "150+"
}
]
}
}
Here is the code what i am trying to do:
for(keys in jsonObject.res){
$scope.<SomeString+keys> = 'something';
}
Please suggest me what would be the better way to achieve this?
Assume jsonObject is the object what i have specified above