English 中文(简体)
1. 记载收集错误
原标题:Subscribing to a collection error
  • 时间:2012-05-12 04:04:37
  •  标签:
  • meteor

我确实不肯定这个问题是什么。 也许我不理解出版/提交书。

在我的服务器目录中:

Meteor.publish("kudos", function () {
  return Kudos.find({});
});

在我的客户名录中:

Meteor.startup(function(){
  Meteor.subscribe("kudos");
});

Template.launchsection.kudos = function () {
  return Kudos.find({});
};

当我执政时,我就错过了<代码>。 回归代码

我失踪了什么?

最佳回答

确保你将Schema定义为一个在客户和服务器上执行的js档案。 file子背面夹中的“Schema.jsquestion

希望帮助!

问题回答

具体来说,你需要在客户和服务器目录上写到<条码>Kudos = 新的气象器。





相关问题
Problems to run examples in Meteor

I m testing Meteor examples and this is what I see when I run meteor in todos examples: Unexpected mongo exit code 100. Restarting. Unexpected mongo exit code 100. Restarting. Unexpected mongo exit ...

Handlebars Exception

Any hints what the following exception might be about? Running on: http://localhost:3000/ No dependency info in bundle. Filesystem monitoring disabled. Errors prevented startup: Exception while ...

How easy to call external Web APIs in Meteor?

Does (or will) Meteor provide a library to handle external Web API calls? E.g. to build a Meteor app that integrates with Facebook Graph API or Google Spreadsheet API.

Meteor - Using collection on client startup

Why this code shows "0"? Shouldn t it return "1"? Messages = new Meteor.Collection("messages"); if (Meteor.is_client) { Meteor.startup(function () { alert(Messages.find().count()); ...

热门标签