2016-09-11 4 views
-1

ネットワークタブを開いてパラメータを確認しましたが、そこにはありません。私は何が間違っていたのだろうか。

$http.get('/app/getAllUser', 
      params: { 
       id: '123' 
      }).then(function(response){ 

     }).catch(function(response) { 
      alert('Error!'); 
     }).finally(function(){ 
      $scope.loading = false; 
     }) 

答えて

0

あなたのルートがどのように見えるかに応じて、idをURLに正しく入れることができます。 「/アプリ/ getAllUser/123」

0

あなたは、オブジェクトの2番目のパラメータをラップする必要があります。

$http.get('/app/getAllUser', { 
    params: { 
     id: '123' 
    } 
}).then(function(response){ 
0

これは、1個のサンプルである以下、あなたのパラメータを渡しているかによって異なります。

function getAuthorByID(authorId) { 
     return $http({ 
      method: 'GET', 
      url: 'api/Author/' + authorId 
     }) 
     .then(sendResponseData) 
     .catch(sendGetAuthorsError); 
    } 
関連する問題