javascript - angular中controller裡面雙層遍歷為何實作不了
仅有的幸福
仅有的幸福 2017-07-05 10:55:57
0
1
767

我需要實現這個功能,把獲得的資料進行遍歷出一層,然後再對每一項遍歷,把每一項的資料的某個值賦予給上一層,但是卻實現不了。怎麼辦?
程式碼: var datalist=[];

var dataDe = data.body.data.assets; for(var i = 0;i
仅有的幸福
仅有的幸福

全部回覆 (1)
学霸

為什麼不行呢,你的程式碼,一行沒改:

var data = { "assets": [ { "id": "001", "assetCount": 14, "availableCount": 9, "price": 2, "startDate": null, "age": 0, "description": "", "assetType": "台式机", "assetName": "赛尔", "assetModel": "Z-01", "userAssetList": [ { "userDTO": { "confirmationDate": null, "firstJobDate": null, "id": "", "userCount": 0, "orgList": [], "roleList": [], "salaryTypeList": [], "socialSecurityList": [], "failCount": 0, "name": "管理员", "personalEmail": "932276768@qq.com", "personalPhone": "", "personalPhoneCountryCode": "86", "lastSalary": 0, "lastSalaryStartDate": null, "currentSalary": 0, "currentSalaryStartDate": null, "birthDate": null, "joiningDate": null, "successCount": 0, "locked": false, "identified": true, "active": false }, "count": 3 }, { "userDTO": { "confirmationDate": null, "firstJobDate": null, "id": "", "userCount": 0, "orgList": [], "roleList": [], "salaryTypeList": [], "socialSecurityList": [], "failCount": 0, "name": "沙琪玛", "personalEmail": "zdygx951@163.com", "personalPhone": "17328121234", "personalPhoneCountryCode": "86", "lastSalary": 0, "lastSalaryStartDate": null, "currentSalary": 0, "currentSalaryStartDate": null, "birthDate": null, "joiningDate": null, "successCount": 0, "locked": false, "identified": true, "active": false }, "count": 2 } ] } ] } var datalist=[]; var dataDe = data.assets; for(var i = 0;i
    最新下載
    更多>
    網站特效
    網站源碼
    網站素材
    前端模板
    關於我們 免責聲明 Sitemap
    PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!