Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError on "canexit="exitValidation"" [Fix included] #251

Open
kufhjer opened this issue Jun 30, 2017 · 3 comments
Open

ReferenceError on "canexit="exitValidation"" [Fix included] #251

kufhjer opened this issue Jun 30, 2017 · 3 comments

Comments

@kufhjer
Copy link

kufhjer commented Jun 30, 2017

Good afternoon,

In my wizard step, I use canexit="exitValidation" to validate a step before going to the next step. In my controller I use the following code;

$scope.exitValidation = function(){
    
    console.log('exit validation');
    
    if( angular.isDefined( $scope.newCompany.name ) )
    {
        return true;
    }
    else
    {
        return false;
    }
};

Whenever the return is true, all is ok. However, when I return false I always get a Reference error shown below;

ReferenceError: _ is not defined
    at ngwizard.min.js:7
    at angular.min.js:134
    at m.$digest (angular.min.js:145)
    at m.$apply (angular.min.js:149)
    at HTMLInputElement.<anonymous> (ngwizard.min.js:7)
    at HTMLInputElement.dispatch (jquery-3.2.1.min.js:3)
    at HTMLInputElement.q.handle (jquery-3.2.1.min.js:3) "Possibly unhandled rejection: {}"

I hope someone is able to help me out with this isue.

Best regards,

Kai van Rijswijk

@kufhjer
Copy link
Author

kufhjer commented Jun 30, 2017

I just added LoDash to my application and the error is gone, I cannot see any reference to LoDash in the documentation. Is this a known issue? If so will this be fixed in future updates?

@kufhjer kufhjer changed the title ReferenceError on "canexit="exitValidation"" ReferenceError on "canexit="exitValidation"" [Fix included] Jun 30, 2017
@AngularPlayer
Copy link

AngularPlayer commented Jul 7, 2017

I have the same problem.
Seen to be an error at line 236
$scope.$emit('wizard:stepChangeFailed', {step: step, index: _.indexOf($scope.getEnabledSteps(), step)});

the underscore as no reference

@kufhjer
Copy link
Author

kufhjer commented Jul 7, 2017

Hey @AngularPlayer,

Noticed the same error at the same line, too (temporarily) fix this, add LoDash to your project.

https://lodash.com/

Best regards,

Kai

@kufhjer kufhjer closed this as completed Aug 9, 2017
@kufhjer kufhjer reopened this Aug 9, 2017
@gmanriqueUy gmanriqueUy mentioned this issue Sep 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants