Created
May 24, 2011 01:41
-
-
Save keolo/988010 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/assets/javascripts/application.js | |
//= require_tree . | |
# app/assets/javascripts/application.js.coffee | |
@application = | |
awesomeFunction: (params) -> | |
console.log(params) | |
# app/assets/javascripts/home.js.coffee | |
$ -> | |
application.awesomeFunction(['Hey', 'there']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The method you show here uses node's require by precompiling the cofffeescript?
Heyo keolo, I have bumped into this a number of times recently
clientside I attach functions to window and node side I attach functions to export.
http://stackoverflow.com/questions/4214731/coffeescript-global-variables/4215132#4215132