Reputation: 490
I have simple problem. I have Foo class and at contructor I starting timer. In timer callback I want alert class property, but I will get "undefined", why?
class Foo
simpleProperty: "fooBar"
constructor: ->
setInterval @runBar, 1 * 1000
return
runBar: ->
alert @simpleProperty #undefined, why?
return
foo = new Foo()
Thank you for your help!
Upvotes: 1
Views: 629