I cope with a coffee script problem when I try to test a javascript object from my it. I have 2 files : a javascript one and a coffee script one which are loaded in this order.
What I need is to define an object in the javascript file:
var my_js_obj = {
string1: "blablabla",
string2: "blobloblo",
string3: "blublublu",
};
And then I try to get this object from my coffee script file :
if not my_js_obj?
my_js_obj = {}
console.log "obj does not exist"
else
console.log "obj exists"
console.log my_js_obj
In my console, I always get an empty object :
obj does not exist
Object {}
I don't know if there's an impact but I'm using Ruby on Rails 4.