Meteor.userId vs Meteor.userId()

╄→尐↘猪︶ㄣ 提交于 2019-12-04 19:14:17
Soren

Have a look in the documentation

  • The function Meteor.userId() is available "Anywhere but publish functions"

  • The variable this.userId is available "Anywhere" (which explicitly is also called out for the Server side Publish function).

I have had the same issue with Meteor.userId() when trying to get a unit testing with mocha to work.

A simple fix is to go to tasks.js and replace Meteor.userId() with this.userId which is to use the this context of the function.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!