javascript - Can not get any value using for each loop of angular.js -
i have problem in angular.js foreach loop.i have console message console.log('course data',response.data);
output given below.
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]
i have code angular foreach loop given below.
angular.foreach(response.data, function(value, key){ console.log(key + ': ' + value); });
but here getting following output of console message given inside code.
0: [object object] 1: [object object] 2: [object object]
i not getting key name value.please me resolve issue.
try this
angular.foreach(response.data, function(obj){ console.log(obj.name + ': ' + obj.value); });
here name , value key of object contains..
Comments
Post a Comment