Created
January 6, 2012 10:44
-
-
Save yurfuwa-chan/1570067 to your computer and use it in GitHub Desktop.
coffeescript example
This file contains hidden or 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
#jQuery module | |
jQuery -> | |
$.deferred.define(); | |
#private variable | |
test = new Test | |
#call test public method; | |
$("#hoge p").click(=>test.test()); | |
#class | |
class Test | |
#private member | |
_json = null | |
getData : -> _json | |
test: => | |
next(=> | |
$.getJSON( | |
"static.json" | |
). | |
next((d) => | |
_json = d | |
) | |
). | |
next(=> | |
console.log("complete") | |
console.log(@getData()) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment