【发布时间】:2013-11-20 02:42:33
【问题描述】:
不再允许“私人”财产访问:
https://groups.google.com/forum/#!msg/angular/7l4j70wlPwI/dgt4chDVseAJ
我的 $scope 返回一个数组。此数组中的对象如下所示:
0: Object
$$hashKey: "004"
FIRST_NAME: "DAVID"
LAST_NAME: "SHORT"
_id: Object
$oid: "5286f54e5b5f47d3bd3145bd"
我想同时访问 FIRST_NAME 和 $oid。我可以得到这样的名字:
<li ng-repeat="result in apiResult">
<form ng-submit="findone()">
<span type="text" ng-model="searchTerm" class="">{{result._id}}</span>
<span class="">{{result.FIRST_NAME}}</span>
<input class="btn-primary" type="submit" value="go">
</form>
</li>
我无法访问 _id。在这个例子中如何返回 id?
【问题讨论】:
-
不。这不起作用
-
该死的 NoSQL...我的
_id通常只返回一个键/值对,这似乎保留了嵌入的对象.. -
在您的示例中,您似乎只是想显示 result._id,但它是一个对象类型。您要显示的对象中是否有原始字段?
-
另外,为什么要添加空类属性?
标签: json angularjs angularjs-ng-repeat