0

I'm just starting with MeteorJS and had a quick question on how the hierarchy works.

Here is my current setup (the file currently opened is server.js)

I feel like i'm not understanding something correctly. My current goal is to make the string "Test School" appear in index.html. What I have tried is saying Meteor.subscribe("schools") in my index.js, and then in my index.html doing the following {{#each schools}} test {{/each}}

However that doesnt seem to work. I want to understand how this works, not just get an answer from here. Currently, what I think should be happening is on the server side a Schools collection is being created, and a test school is being inserted. Then, I am publishing the schools so that when someone subscribes to it, they receive all the schools in the schools collection.

I've looked around online for many sources and examples of meteor, but cant seem to find one that splits up the hierarchy like mine (client/server/public), and does what I'm trying to do (mongo in server.js, retrieve info in clientside)

If anyone could tell me how to correctly make "test school" appear in my index.html, or give me any sort of advice, it would be greatly appreciated.

Meeoh
  • 463
  • 4
  • 11
  • Shameel did you make it work? – Ethaan Feb 17 '15 at 18:12
  • Unfortunately no, I still cant get it to work. Here is my modified setup index.html: http://puu.sh/g5NFJ/be5c2ed176.png bootstrap.js: http://puu.sh/g5NHl/0955ba45a8.png publish.js: http://puu.sh/g5NIn/ddf2e85fce.png Then in collections.js im creating the new collection, and in router.js im subscribing Ive been trying to follow the "todos" example that you posted earlier. I noticed they had a `publish.js` file, and in their `router.js` they subscribe to all the publications so that every file has access to every publication. One question I have is how to they actually use the publication? – Meeoh Feb 21 '15 at 01:44

0 Answers0