0

我正在向服务器发送扩展查询

var query = breeze.EntityQuery.from("Incidents")
                        .expand("IncidentComments")
                        .where("IncidentID", "eq", incidentId);

并且在 http 我得到的结果是好的,具有相关实体的实体当我从微风中的查询返回时我怎么看不到数据 IncidentComments 没有评论

function getSucceeded(data) {
        $scope.incident = data;
        $scope.incidentComments = data.IncidentComments;
    }
4

1 回答 1

0

假设“IncidentComments”是“Incident”的一个属性,那么评论将照此返回。所以:

var query = breeze.EntityQuery.from("Incidents")
                    .expand("IncidentComments")
                    .where("IncidentID", "eq", incidentId);
var myEntityManager.executeQuery(query).then(function (data) {
   var incidents = data.results;
   var incident = incidents[0]; // because you are only returning one incident;
   var incidentComments = incident.incidentComments; 
});
于 2013-05-24T16:36:04.733 回答