Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9100749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:56:37+00:00 2026-06-17T00:56:37+00:00

Does AngularJS have Limit and Offset request methods when calling an external data resource

  • 0

Does AngularJS have Limit and Offset request methods when calling an external data resource that supports them?

I imagine there is a more elegant solution than this, where I am passing the limit and offset via the routeParams:

function ListCtrl($scope, $http, $routeParams) {
$http.jsonp('http://www.example.com/api/list.jsonp?callback=JSON_CALLBACK&limit=' + $routeParams.limit + '&offset=' + $routeParams.offset,{callback: 'JSON_CALLBACK'}).success(function(data) {
$scope.list = data;
  });
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:56:38+00:00Added an answer on June 17, 2026 at 12:56 am

    A complete pagination solution is: (1) a service that communicates with the server/database, (2) a directive to handle next/prev, and (3) a controller to glue it together.

    Once you have the directive and the service, your controller is as simple as this:

    app.controller('MainCtrl', function($scope, myData) {
      $scope.numPerPage = 5;
      $scope.noOfPages = Math.ceil(myData.count() / $scope.numPerPage);
      $scope.currentPage = 1;
    
      $scope.setPage = function () {
        $scope.data = myData.get( ($scope.currentPage - 1) * $scope.numPerPage, $scope.numPerPage );
      };
    
      $scope.$watch( 'currentPage', $scope.setPage );
    });
    

    With equally simple HTML:

    <body ng-controller="MainCtrl">
      <ul>
        <li ng-repeat="item in data">{{item.name}}</li>
      </ul>
      <pagination num-pages="noOfPages" current-page="currentPage" class="pagination-small"></pagination>
    </body>
    

    Here’s a complete Plunker: http://plnkr.co/edit/Mg0USx?p=preview. It uses the pagination directive of ui-bootstrap, which is a work in progress.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form, generated through rails helpers, that has some AngularJS on it.
All, we're developing a webapp with AngularJS and we have a use case/requirement (that
I have an AngularJS directive that renders a collection of entities in the following
I have an AngularJS $resource : App.factory(pjApi, [$resource, function($resource) { return $resource(/api/:user/:action/:post_id/, {action:posts}); }]);
I have a certain angularjs service below.. angular.service('SubmitPayment', function($resource){ return $resource('api/SubmitPayment', {}, { query:
I am learning AngularJS and have built a small application. Now that it's functionally
I am working on single-page AngularJS application that doesn't have any backend but use
Does anyone have any experience in documenting/structuring angularjs projects so the JSDoc can generate
I don't quite get how to properly use AngularJS's $resource. For example, I have
I have a project written in CoffeeScript that uses AngularJS. My vendor dependancies are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.