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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -