【发布时间】:2013-05-31 09:26:59
【问题描述】:
如果我声明一个全局集合如下:
@Matches = new Meteor.Collection "Matches"
如何在 Meteor 的服务器端和客户端的闭包中找到一致的方式来访问它?
例如,下面的代码不起作用,因为@ 指的是this(它不是闭包中的顶级命名空间)
Meteor.publish("current-matches", ->
return @Matches.find(round: 0) # @Matches doesn't work since `this` is something else
)
【问题讨论】:
标签: coffeescript meteor