Having an issue with my Angular.js foreach loop. When I use
console.log('course data',response.data);
the output looks like this:
course data [Object, Object, Object]
0: Objectcourse_name: "Master of computer
1: Objectcourse_name: "Bachelor of Technology"
2: Objectcourse_name: "Master in Technology"
length: 3__proto__: Array[0]
Below is my code for the Angular foreach loop:
angular.forEach(response.data, function(value, key){
console.log(key + ': ' + value);
});
However, when I run the code, the console message shows:
0: [object Object]
1: [object Object]
2: [object Object]
I'm not able to get the key name and its value. Can someone help me fix this problem?