Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在这里,我有一个包含许多对象的数组。在那我有一个字段作为“id”。我只想要值为 null 的 id。怎么选?
$scope.hierarchyList = response.data;
那么如何采摘价值呢?
如果没有办法知道response.data. 一种方法(如果我理解的话)是:
response.data
var resultObj; $scope.hierarchyList.forEach(function(hierarchy){ if(hierarchy.id === undefined){ resultObj = hierarchy; } })
如果不是这种情况或您要问的问题,请告诉我。