fix(slideBox): if selected binding is string, parse to integer

This commit is contained in:
Andrew
2014-12-04 13:28:41 -07:00
parent e44c2b5228
commit ee1d5d9ce8
2 changed files with 20 additions and 0 deletions

View File

@@ -178,6 +178,8 @@ function(scope, element, $log, $document, $$q, $timeout, $interval, $$ionicAttac
// adds data to the queue for selection.
// Index can be either a number or a getter (to be called when starting the slide)
function select(newIndex, transitionDuration, isDrag) {
newIndex = parseInt(newIndex);
if (isNaN(newIndex) || newIndex < 0) return;
slideQueue.unshift([
angular.isFunction(newIndex) ? newIndex : function() { return newIndex; },
transitionDuration || SLIDE_TRANSITION_DURATION,