How can I get both the key name and value of a JSON object using Angular's forEach method?
var institute = {
"courses": [],
"user_type": 3,
"institute_name": "sd",
"tagline": "sd",
"overview": "sd",
"specialities": "sd",
"image": "dsd(2).sql"
};
The above is the JSON data I've in a variable institute I need to access both the name and value. I've tried this:
angular.forEach(data,function (key,value){
//key returns 0,1,2,3
//value returns courses,user_type etc
//i need like eg) fd.append(user_type,3);
});