class SocialStudies
constructor : (@val1,@val2) ->
console.log 'constructed '+@val1+' | '+@val2
doAlerts :
firstAlert : =>
alert @val1
secondAlert : =>
alert @val2
secondPeriod = new SocialStudies 'git to class!', 'no recess for you!'
secondPeriod.doAlerts.firstAlert() // error this.val1 is not defined
希望你明白这一点。我想@val1
从方法中设置的方法访问,而胖箭头什么也不做!有谁知道在这里做什么?