從this comment由大衛·格拉瑟在GitHub上的問題來看:流星 - 爲什麼我應該儘可能使用this.userId通過Meteor.userId()?
的細節語法糖
this.userId
是主要的API和Meteor.userId()
是用戶新的JavaScript誰可能不明白成功地利用這個尚未
看來我們應該儘可能使用this.userId
(例如在一個方法函數中,您可以同時使用這兩個函數),並且只在發佈函數中使用Meteor.userId()
。如果這個假設是正確的,爲什麼?
(參見代碼中的相關內容也將是有益的,我似乎無法找到它)
的可能重複的[Meteor.userId VS Meteor.userId()](http://stackoverflow.com/questions/24320754/meteor-userid-vs-meteor-userid) – CollinD
@CollinD這個問題是與問候到'Meteor.userId'和'Meteor.userId()'。這個問題是關於'this.userId' vs'Meteor.userId()' – dayuloli
有一個似乎相關的答案。它特別引用你的問題。對不起,如果不是。 – CollinD