我的服务器端代码
Meteor.methods({
'doCount': function(){
var x = ProductList.find().count();
console.log(x);
return x;
}
});
和我的客户端代码是
Meteor.call('doCount', function(error, result) {
console.log("lenght of counters variable is "+counters.length);
var queryResult = ProductList.find().fetch();
for(i=0 ; i< result; i++){
console.log("current Time >>> "+ TimeSync.serverTime();
console.log("expire Time "+ queryResult[i].expire);
}
});
虽然Chrome浏览器每次都返回正确的日志。 Firefox以奇怪的方式运行。这是截图
我还使用meteor-timesync包进行TimeSync.serverTime()
函数调用。