This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extended answer: http://stackoverflow.com/questions/11873570/angularjs-for-loop-with-numbers-ranges/17124017#17124017 | |
// By caching the function result, it can become orders of magnitudes more efficient (depending on how big the range is) | |
// jsPerf: http://jsperf.com/memoizer-range/9 | |
$scope.range = (function() { | |
var cache = {}; | |
return function(min, max, step) { | |
var isCacheUseful = (max - min) > 70; | |
var cacheKey; |