大きな要素のコレクションを持つ表を表示しようとしています。テーブルを改ページし、現在のページに表示されている要素だけを読み込みたいとします。今、jsonに$resource
がロードされます。
私はhereを読んで、jsonヘッダーの内側にページ分割情報(currentPage、pagesCount、およびelementsCount)を渡すことをお勧めします。
角度からjsonヘッダにある情報にどのようにアクセスできますか?ここで
は、基本的なjsの構造である:AngularJS $リソースのドキュメントに基づいて
angular.module('App.services', ['ngResource']).
factory('List', function($resource){
return $resource('url/of/json/:type/:id', {type:'@type', id:'@id'});
});
angular.module('App.controllers', []).
controller('ListCtrl', ['$scope', 'List', function($scope, List) {
var $scope.list= List.query({offset: 0, limit: 100, sortType: 'DESC' });
}]);
扱う[方法の可能性のある重複ページ区切りとanglejsリソースでカウント?](http://stackoverflow.com/questions/16465768/how-to-handle-pagination-and-count-with-angularjs-resources) – JBCP