question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ceil is equal to NaN after changing the state

See original GitHub issue

The first time the slider works fine, but when I leave the state and come back to it, the slider freezes (ceil not correct it is NaN), I tried $timeout(function () { $scope.$broadcast('rzSliderForceRender'); });

but it did not solve the problem.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
guti1690commented, Apr 5, 2016

Other solution to fix this is using the ngIf directive with a flag in the rzslider directive:

<rzslider ng-if="ctrl.slider.isVisible" rz-slider-model="ctrl.slider.value"></rzslider>

1reaction
dmbjsncommented, Feb 18, 2016

Hey @ainouss , I just had the same problem. The solution for me was to move the init of the options object from postLink to preLink. Don’t know if this works in your case, but give it a try. In short, I went from this:

link: function(scope, elem, attr) {
    scope.slider = {};
    scope.slider.options = {
        ceil: someNumber
    }
}

to this:

link:  {
    pre: function(scope, elem, attr) {
        scope.slider = {};
        scope.slider.options = {
            ceil: someNumber
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does isNaN(" ") (string with spaces) equal false?
When the argument to the isNaN function is not of type Number, the value is first coerced to a Number. The resulting value...
Read more >
NaN - JavaScript - MDN Web Docs
The global NaN property is a value representing Not-A-Number. ... When NaN is one of the operands of any relational comparison ( >...
Read more >
numpy.nan_to_num — NumPy v1.24 Manual
Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the ... This means that Not a Number is...
Read more >
Math.Ceiling Method (System) | Microsoft Learn
If a is equal to NaN, NegativeInfinity, or PositiveInfinity, that value is returned. Note that this method returns a Double instead of an...
Read more >
Mathematical functions | BigQuery - Google Cloud
All mathematical functions have the following behaviors: They return NULL if any of the input parameters is NULL . They return NaN if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found