The coffeescript compiler is, for some reason, wrapping all of my .coffee files in a function when they are compiled. For example, if I have test.coffee:
cla
Never add event listeners in HTML. Add them in your JavaScript, preferably in the same scope in which you define the event handler.
printAValue = () ->
test = new TestClass()
test.printValue()
document.body.addEventListener('load', printAValue, false)
If you absolutely need to export something to the global scope, export to the window object:
window.printAValue = () ->
test = new TestClass()
test.printValue()