更新时间:2023-02-12 08:07:24
$scope.data = EdgeService.tickets()
应该是
EdgeService.tickets().then (data) ->
$scope.data = data
AngularJS 不会自动解包承诺在较新版本中.这适用于旧版本的 Angular.
AngularJS does not automatically unwrap promises in newer versions. This would work in older versions of Angular.
要执行多个相互依赖的 API 调用,您可以这样做
To do multiple API calls dependant of one another you can do
callA
.then(callB)
.then(callC)
你可以使用 $q.all 并行执行多个操作
Yo can do multiple in parallell using $q.all
$q.all([callA, callB, callC]).then( .... )