From 078b00396e6c41fd39db04321cafff94cd7b0ba0 Mon Sep 17 00:00:00 2001 From: Dat Pham Date: Mon, 26 Jun 2017 17:30:05 +0700 Subject: [PATCH] $on('wizard:stepChangeFailed') will return the current step fail --- src/wizard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wizard.js b/src/wizard.js index d0c0b94..8438b12 100644 --- a/src/wizard.js +++ b/src/wizard.js @@ -169,7 +169,7 @@ angular.module('mgo-angular-wizard').directive('wizard', function() { $scope.$emit('wizard:stepChanged', {step: step, index: stepIdx(step)}); //$log.log('current step number: ', $scope.currentStepNumber()); } else { - $scope.$emit('wizard:stepChangeFailed', {step: step, index: _.indexOf($scope.getEnabledSteps(), step)}); + $scope.$emit('wizard:stepChangeFailed', {step: $scope.getEnabledSteps()[thisStep], index: thisStep}); } }); }