我想有一個Ruby提供了一個靜態方法'inherited'你自己的模塊的操作目的文檔中看到相同的方法:如何知道何時Coffeescript繼承了Class?
class Foo
@inherited: (subclass) ->
console.log('hey hou')
class Hey extends Foo
class Hou extends Foo
輸出:
=> hey hou
=> hey hou
我怎樣才能實現這個目標與Coffeescript'延伸'?我的意思是,如果我使用Backbone.js的'extend'方法,我可以覆蓋它..但Coffeescript編譯它,這是不可能的。
有什麼想法?