Angular Resource calls and $q

前端 未结 4 797
失恋的感觉
失恋的感觉 2020-12-24 02:37

Folks,

I have my code setup somewhat as below:

$scope.init = function(){
  return $q.all([resource1.query(),resource2.query(),resource3.query()])
            


        
4条回答
  •  滥情空心
    2020-12-24 02:52

    For those still trying to figure out a better way to go about this, try this:

      resource.query().$promise.then(function(result) {
        console.log(result);
        // Do something else, like instantiate a JS driven table
      });
    

提交回复
热议问题