2014-09-24 72 views
0

我的查詢使用Restangular時出錯,它沒有返回我的過濾數據。我已經嘗試了以下所有內容:帶過濾器的Restangular查詢

$scope.welcomes = Restangular.all("projects").getList({'name': "g"}).$object; 
$scope.welcomes = Restangular.all("projects").customGET("findOne", {"filter[where][title]": "g"}); 
$scope.welcomes = Restangular.one("projects").customGET({name: "g"}); 
$scope.welcomes = Restangular.all("projects").customGET({name: "g"}); 

我真的很感激你有什麼建議來分享。

回答

0

在回調函數的返回Restangular數據作爲參數,示例:

Restangular.one('user', $stateParams.id).get().then(function(response) { 
      vm.users = response.data; 
      // console.log('response.status:' + response.status); 
     }); 

我希望這幫助你,或者你提高的問題,我會回來的