CoffeeScript Indent Error
Any idea why this would throw an error when compiling?
(window) ->
# pubsub
App.publish = (topic,args) ->
App.subscriptions[to开发者_开发问答pic] and $.each(App.subscriptions[topic], ->
this.apply(App, args or [])
http://jsfiddle.net/wesbos/4Kf2B/
Never mind, I'm silly and forgot a remove paren :\
(window) ->
# pubsub
App.publish = (topic,args) ->
App.subscriptions[topic] and $.each App.subscriptions[topic], ->
this.apply(App, args or [])
精彩评论