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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:13:24+00:00 2026-06-10T19:13:24+00:00

I need to be able to access the current element of ng-repeat inside a

  • 0

I need to be able to access the current element of ng-repeat inside a directive. See the jsfiddle for this:
http://jsfiddle.net/terebentina/TVEnN/

I am expecting a hash in the console (like {width: 100, height: 100}) but I am not really sure how to do that.

Any help would be much appreciated.

  • 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-10T19:13:25+00:00Added an answer on June 10, 2026 at 7:13 pm

    Here is a fiddle that works ( and outputs what you are expecting).

    http://jsfiddle.net/TVEnN/2/

    Things to Note about ng-repeat:

    1. ng-repeat always creates a NEW SCOPE for each element in the array / object.
    2. The current element is available in this new scope as the name of the element defined in the ng-repeat. For ex: if you defined ng-repeat = "page in pages" then the current element is available in the scope as page. If you defined ng-repeat = "(key,value) in object" both key and value are available in this new scope.
    3. The current position in the array is available as $index.
    4. Since ng-repeat creates a new scope and all scopes inherit from their parent the pages in the above example is still available in this new scope, which means you could do stuff like $scope.pages.length if you need to.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file as documentRoot/app/webroot/myFile.php I need to be able to access this
I need to be able to access the identifier GUID of the current running
I need to be able to access a list throughout my Rails project. For
I need to be able to access a property via reflection, and, knowing that
I need my app to be able access an third party API who limits
I need to be able to access the size of the view's canvas to
I have a requirement where I need to be able to access a list
My app only allows access if the current user is a specific type, this
Users of the website need to able to store images in their area ,
Need to be able to pull Magento products into an external template. Need to

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.