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 8376585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:27:49+00:00 2026-06-09T15:27:49+00:00

Can a combination of AngularJS filter , order , or limitTo for ng-repeat mimic

  • 0

Can a combination of AngularJS filter, order, or limitTo for ng-repeat mimic the _.last in UnderscoreJS?

  • 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-09T15:27:51+00:00Added an answer on June 9, 2026 at 3:27 pm

    If I’m understanding your question correctly I think this fiddle would do it.

    For this data:

    $scope.items = [{sort: 1, name: 'First'}, 
                    {sort: 2, name: 'Second'}, 
                    {sort: 3, name: 'Third'}, 
                    {sort: 4, name:'Last'}];
    

    If you don’t want to actually sort the array and just take the last two items of the array as is (like underscore’s last) you can try a negative limit (this would show Third, Last):

    <div ng-repeat="item in items | limitTo:-2">
    

    Also note you can chain the filters together like this example sorting the data in reverse and taking 2 items (this would show Last, Third):

    <div ng-repeat="item in items | orderBy:'sort':true | limitTo:2">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can I use combination of OR and AND in mongodb queries? the code below
How can I bind a key combination to my vb.net application? I know it
I have a from where you can fill in any combination of your home,
I usually end up trying every combination until it compiles. Can somebody explain what
I have a file which is combination of PHP and HTML. How can i
What coding tricks, compilation flags, software-architecture considerations can be applied in order to keep
I've tried every combination I can think of in terms of how to configure
I am creating a system where a user can select any combination of four
I am looking for a solution in Flex where I can capture a combination
How I can send a combination of keys (like Ctrl+C or Alt+Shift) when cursor

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.