0

ngResource を使用して syllableCount をボタンをクリックするように設定する次のサービスがあります。

 //Words service used to communicate Words REST endpoints
(function () {
  'use strict';

  angular
    .module('words')
    .factory('querywordsService', querywordsService);

  querywordsService.$inject = ['$resource'];

  function querywordsService($resource) {
    return $resource('api/words/?syllableCount=:count', {syllableCount: '@count'},
    {
      update: {
        method: 'PUT'
      }
    });
  }
})();

syllableCount ボタン 2 をクリックすると、クエリは特定の単語を表示します。コントローラでの表示は次のとおりです。

    $scope.searchCount = function (count) {
      $scope.searchWords = querywordsService.query({count: count});
};

すべてがうまくいきます!しかし、クエリ内で syllableCount 以上が必要です。内部に入る必要がある他のパラメーターが少なくとも 4 つあります。それらを次のようにチェーンするだけの場合:

api/words/?syllableCount=:count&?syllableStructur=:struct .... 

動いていない。

上記のように複数のクエリをチェーンする良い方法はありますか?

4

1 に答える 1