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: Can't find variable: gon in Javascript Test Case #236

Open
shazimkhandevsinc opened this issue Dec 8, 2017 · 0 comments

Comments

@shazimkhandevsinc
Copy link

I wrote these lines in application layout file

= csrf_meta_tags
= Gon::Base.render_data({}) 

and assign values to gon in Rails controller and using in angular controller with $scope
In Rails controller

gon.hotel_data = hotel_data
In Angular controller

$scope.hotel = gon.hotel_data

gon variable is accessible in angular controller
But when I write test case for this controller and it shows this error in angular controller when I run test case

ReferenceError: Can't find variable: gon

Kindly let me know how to initialize gon variable in Javascript test case

Thanks

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

1 participant