我堅持用foreach循環,我不知道列名,所以我不能做 value.Job
,我需要用它來顯示所有colums具體數據通用foreach循環和AngularJs
angular.forEach(data, function(value, key) {
console.log('the Object N° ' + i);
'maybe another loop for all the column
console.log('the column name is + ': ' + value ??);
});
的結果應該是這樣的:
the Object N° 1
the column name is Name : Matt
the column name is Job : Teacher
the Object N° 2
the column name is Name : Alice
the column name is Job : Doctor
這裏的任何想法!
我想看到JavaScript和AngularJs for each的選項。
你能分享的樣本你的數據是如何構成的d? – EranSch
什麼是「我」變種? – nolan
列名存儲在哪裏? – Roysh