Callback bindings
jonathan-s opened this issue · 1 comments
jonathan-s commented
Looking at the following code. According to the recipe on Callback bindings next should be executed. However it is not.
class MyClass:
constructor: () =>
@showCarouselInfo()
@next()
next: () =>
console.log 'fires'
showCarouselInfo: =>
getIndex = (string) =>
number = parseInt(string.match(/\d+/))
$('.ball').on 'click', (e) =>
console.log('fire')
index = getIndex(e.currentTarget.id)
info = $('.carousel-wrapper > p')
@next(info[index])
sukima commented
Check your indentations, Looks like coffescript could be compiling it wrong if that's the actual code and not a copy/paste mishap on the white spacing.