我是新来的咖啡标记,并有一个关于访问函数的问题。Coffeescript访问函数
鉴于以下代码,我将如何从构造函数的for循环访问checkType函数?
class ApplicationForm.Save
constructor: (@formItems) ->
@that = this
for item in @formItems
do ->
checkType(item)
checkType: (forItem) ->
console.log(@formItem.find("input").length)
你为什么这样做'@that = this'? (转换为'this.that = this') – Mathletics