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

  • SEARCH
  • Home
  • 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 9266767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:23:38+00:00 2026-06-18T14:23:38+00:00

I see the limitTo filter in the docs, which allows me to limit the

  • 0

I see the limitTo filter in the docs, which allows me to limit the first 5, or last 5 results, but I want to set where my limit starts so I can show the second set of 5 results.

Is there a built in filter for that?

  • 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-18T14:23:39+00:00Added an answer on June 18, 2026 at 2:23 pm

    Since Angular 1.4.0, the limitTo filter takes an optional begin argument:

    <div ng-repeat="item in items | limitTo:5:5">{{item}}</div>
    

    In older versions, writing a custom filter is fairly straightforward. Here’s a naïve implementation based on Array#slice (note you pass the first and last index, instead of a count):

    app.filter('slice', function() {
      return function(arr, start, end) {
        return (arr || []).slice(start, end);
      };
    });
    
    <div ng-repeat="item in items | slice:6:10">{{item}}</div>
    

    Working jsFiddle: http://jsfiddle.net/BinaryMuse/vQUsS/

    Alternatively, you can simply steal the entire Angular 1.4.0 implementation of limitTo:

    function limitToFilter() {
      return function(input, limit, begin) {
        if (Math.abs(Number(limit)) === Infinity) {
          limit = Number(limit);
        } else {
          limit = toInt(limit);
        }
        if (isNaN(limit)) return input;
    
        if (isNumber(input)) input = input.toString();
        if (!isArray(input) && !isString(input)) return input;
    
        begin = (!begin || isNaN(begin)) ? 0 : toInt(begin);
        begin = (begin < 0 && begin >= -input.length) ? input.length + begin : begin;
    
        if (limit >= 0) {
          return input.slice(begin, begin + limit);
        } else {
          if (begin === 0) {
            return input.slice(limit, input.length);
          } else {
            return input.slice(Math.max(0, begin + limit), begin);
          }
        }
      };
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my database I can easily see the last 50 people in my table
I have results in a list that I wish to filter. The user can
As you can see in http://thefreefallband.com/super in the last post there's an image too
see fiddle I want to drag the mouse on cell and whatever is under
I have a textarea element what i want to limit to, lets say, 100
Is there a limit to the number of requests I can make with the
Is there some limit to what I can select in a range via VBA?
I have to deal with queries that have lots of results, but I only
Is there a limit to the number of included files deep you can go
See Deepa answer for the solution :) I read all of the solution given

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.