Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range filter infinite digest #228

Open
vjoao opened this issue Nov 24, 2016 · 0 comments
Open

Range filter infinite digest #228

vjoao opened this issue Nov 24, 2016 · 0 comments

Comments

@vjoao
Copy link

vjoao commented Nov 24, 2016

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant