Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Range filter infinite digest

Open
#228 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
angularjs
Domain
frontend

Research direction

The issue is about the 'range' pipe causing an infinite digest cycle when used with a transformer function. Start by examining the range filter implementation in the angular-filter library. The provided jsfiddle (https://jsfiddle.net/9coywzgt/5/) reproduces the problem; run it to see the error. Investigate how the transformer function interacts with AngularJS's digest cycle, and check if the returned object changes on each call. Look for existing tests related to the range filter to understand expected behavior. The fix likely involves ensuring the transformer output is stable across digest cycles.

Written by the indexing model from the issue text.

Description

Hello

I'm trying to use the range pipe with some controller variables like this:

<div ng-repeat="time in [] | range: $ctrl.end - $ctrl.start : $ctrl.start : 1 : $ctrl.transformer">
<span class="hour">{{time.hour}}</span> <span class="minutes">{{time.minutes}}</span>
</div>

The problem is this statement is giving me a infinite digest cycle. If I take the $ctrl.transformer function out the problem goes away, but I need that function to transform the input.

Please note that $ctrl.transformer is returning an Object like this:

$ctrl.transformer = function (time) {
  return {
    hour: ... (hour calculation),
    minutes: ... (minutes calculation)
  }
}

Is there something I don't see?

EDIT:

Fiddle to reproduce
https://jsfiddle.net/9coywzgt/5/

Dominant language
JavaScript
Stars
2.9k
Forks
319
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from a8m/angular-filter

All issues in a8m/angular-filter

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.