我认为您不能直接使用Promise对象,而应使用文档
then中所述的回调。
这意味着您
$scope.objects = dataService.getData();
而是应该像
dataService.getData().then(function(data) { $scope.objects = data;});否则,您
$scope.objects将包含promise对象,而不包含要传递给的数据
resolve。
在这里查看更新的小提琴。

我认为您不能直接使用Promise对象,而应使用文档
then中所述的回调。
这意味着您
$scope.objects = dataService.getData();
而是应该像
dataService.getData().then(function(data) { $scope.objects = data;});否则,您
$scope.objects将包含promise对象,而不包含要传递给的数据
resolve。
在这里查看更新的小提琴。