Tag: coffeescript frappe

在nodejs frappe中需要path

所以我正在试验nodejs,并select了frappe作为学习的骨架(因为我已经在前端使用了coffeescript等等等等等等)。 无论如何,我只是开始,并遇到了一个问题,所以没有,我不能在谷歌上find答案。 上面的图片应该说明一切。 我的path/ config / globals有什么问题? 我努力了: ./config/globals /config/globals globals 无济于事。 我在这里错过了什么?

Coffeescript类语法不同节点?

现在我已经在前端使用了coffeescript几年了。 熟悉类语法看起来像这样: class MyClass methodOne : -> console.log "methodOne Called" methodTwo : (arg, arrg) -> console.log "methodTwo Called" 最近我一直在玩节点和frappe样板的web应用程序与咖啡和节点。 此脚本使用以下语法的路由使用CoffeeScript类: class MyClass @methodOne = -> console.log "methodOne Called" @methodTwo = (arg, arrg) -> console.log "methodTwo Called" 我可以从我的正常使用中注意到唯一的用法差异是Routes.coffee文件直接消耗类,而不是创build一个new对象。 所以: MyClass.methodOne() # vs new MyClass().methodOne() 现在我已经了解到, @methodOne语法不使用.prototype而另一种语法则使用。 但是,为什么这会导致使用失败?