This should be a really simple question, but I’m still having difficulty.
I have a namespace and a single member function as follows:
fb =
test1: ->
console.log "test"
However, when I try to call the function in another file by using
fb.test1()
it doesn’t recognize ‘fb’ as the namespace name. I have made sure that both files are sharing the same ‘window’ by making the proper inclusions.
EDIT:
this code worked with the function call:
window.fb.test1()
and the namespace declaration:
window.fb
Assuming you are doing this in the browser, try changing
fb =towindow.fb =and then see if you are able to find it in the “other file”. You could also compile both files using--joinor--bare, but be aware of the consequences.