meteor

Publishing/subscribing multiple subsets of the same server collection

拜拜、爱过 提交于 2019-12-17 08:47:44
问题 EDIT: this question, some of the answers, and some of the comments, contain a lot of misinformation. See how Meteor collections, publications and subscriptions work for an accurate understanding of publishing and subscribing to multiple subsets of the same server collection. How does one go about publishing different subsets (or "views") of a single collection on the server as multiple collections on the client? Here is some pseudo-code to help illustrate my question: items collection on the

Is there a way to pass variables into templates in Meteor?

笑着哭i 提交于 2019-12-17 08:36:29
问题 I've been experimenting with Meteor and ran into something I couldn't figure out. For fun, I was trying to make a slot machine. I had the following HTML: <div class="slot-wrapper"> {{> slot}} {{> slot}} {{> slot}} </div> <template name="slot"> <div class="slot"> <div class="number"><span>{{ number }}</span></div> <div class="divider"></div> </div> </template> I want to have a different number for each slot. Is it possible to pass variables into template? Something like this: <div class="slot

How to build a Meteor smart package

空扰寡人 提交于 2019-12-17 08:29:47
问题 How can one build a Meteor smart package that would show up in meteor list ? Building Atmosphere packages is reasonably well documented, but building Meteor packages isn't. 回答1: Meteor now supports a create --package command. See the meteor docs. Example (substitute your own meteor developer account for "cunneen"): meteor create --package cunneen:foo Output: cunneen:foo: created in your app Results: packages/cunneen:foo/package.js Package.describe({ name: 'cunneen:foo', version: '0.0.1', //

How to get the user IP address in Meteor server?

杀马特。学长 韩版系。学妹 提交于 2019-12-17 07:19:13
问题 I would like to get the user IP address in my meteor application, on the server side, so that I can log the IP address with a bunch of things (for example: non-registered users subscribing to a mailing list, or just doing anything important ). I know that the IP address 'seen' by the server can be different than the real source address when there are reverse proxies involved. In such situations, X-Forwarded-For header should be parsed to get the real public IP address of the user. Note that

How to get the user IP address in Meteor server?

喜欢而已 提交于 2019-12-17 07:19:11
问题 I would like to get the user IP address in my meteor application, on the server side, so that I can log the IP address with a bunch of things (for example: non-registered users subscribing to a mailing list, or just doing anything important ). I know that the IP address 'seen' by the server can be different than the real source address when there are reverse proxies involved. In such situations, X-Forwarded-For header should be parsed to get the real public IP address of the user. Note that

Displaying loader while meteor collection loads

独自空忆成欢 提交于 2019-12-17 06:35:41
问题 I have a template, task_list , that looks like this: {{#each tasks}} {{> task}} {{/each}} Template.task_list.tasks returns a collection and in the ui, it seems to take a bit of time to load. While the collection is loading, I'd like to show a loading indicator. Any ideas on how I might be able to do that? BTW, I did try the templates' rendered event on task_list template, however it gets fired before the list is actually loaded. I also tried using rendered on the task template but it seems to

Problems to run examples in Meteor

守給你的承諾、 提交于 2019-12-17 06:34:18
问题 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 code 100. Restarting. Can't start mongod. Check for other processes listening on port 3002 or other meteors running in the same project. And this is what happens if I run mongod in the command line: Thu Apr 12 19:27:39 Mongo DB : starting : pid = 2686 port = 27017 dbpath = /data/db/ master = 0

What are the best practices for structuring a large Meteor app with many HTML template files? [closed]

点点圈 提交于 2019-12-17 06:19:11
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . In all the examples (leaderboard, wordplay, etc.) they have one single HTML template file. Is there some large open source Meteor project with many different HTML template files we can use as a best practice example? Doesn't seem practical to put everything a large app needs

Meteor: difference between names for collections, variables, publications, and subscriptions?

别说谁变了你拦得住时间么 提交于 2019-12-17 06:13:57
问题 In the Discover Meteor examples, what's the diff between "posts" and "Posts"? Why is it that when we do an insert from the server we use "posts" but when querying from the browser we use "Posts"? Wouldn't the system be confused by the case differences? I see the variable assignment for client Posts to the server posts in posts.js. Is it a conventional notation to capitalize client and use small caps for server? Posts = new Meteor.Collection('posts') Why does server/fixtures.js use "Posts"? I

How do we or can we use node modules via npm with Meteor?

余生颓废 提交于 2019-12-17 03:49:27
问题 How do we or can we use node modules via npm with Meteor? Or is that something that will be dependent on the packaging API? Or is there a prescribed method that is recommended? 回答1: Meteor 1.3, released on March 28, 2016, gives apps full ES6 (ES2015) modules support and out of the box NPM support. Apps and packages can now load NPM modules directly and easily on the client and on the server. If you can use 1.3, then check http://guide.meteor.com/using-packages.html#installing-npm. For example