1
我得到的角度的物體看起來像這樣:角 - 如何使角對象數組
quiz.js:129 m {$promise: Promise, $resolved: false}
439:"https://mysite.no/sites/default/files/styles/quiz_large/public/fields/question-image/istock_000059790188_large.jpg?itok=62PzCown"
679: ""
1379:"https://mysite.no/sites/default/files/styles/quiz_large/public/fields/question-image/istock_000000301688_medium.jpg?itok=poGpHb5c"
1529:"https://mysite.no/sites/default/files/styles/quiz_large/public/fields/question-image/istock_000011483027_large.jpg?itok=LJ3f0c-X"
2022:"https://www.mysite.no/sites/default/files/styles/quiz_large/public/fields/question-image/208458_thumbnail.jpg?itok=6AG_2XS3"
$promise: Promise
$resolved: true__proto__: Object
,我需要做的陣列進行數據的,但不知道如何做這個。
在您的數據上添加循環並逐個添加到一個數組中 –
請您詳細說明一下嗎?我不確定上面給出的代碼是否是報告的異常或您想要轉換爲數組的所需對象。 –
參考這個答案:http://stackoverflow.com/questions/684672/how-do-i-loop-through-or-enumerate-a-javascript-object – PerfectPixel