Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Check for possible step calculation #3590

Closed
wants to merge 1 commit into from

Conversation

fabiocarneiro
Copy link
Contributor

Currently, if you set md-discrete and step 0 in sliders, it will still try to calculate the numSteps, causing the entire application to fail.

@fabiocarneiro
Copy link
Contributor Author

@ThomasBurleson Thanks for merging it.

Just to clarify, I was using early return and yoda conditions, which usually leads to a cleaner code and avoids "else" statements. You inverted the logic.

I understand you're using log instead of error, but it still could be done by keeping the same (better) code structure.

if(0 >= step) {
    $log.error('Slider step value must be greater than zero when in discrete mode');
    return;
}

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

Successfully merging this pull request may close these issues.

1 participant