Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy can't I render this simple list with Meteor?
    primarykey
    data
    text
    <p>This very simple app is not working. My list is not showing up. Why? I must be missing something important about how Meteor works. </p> <p><strong>recipes.html</strong></p> <pre class="lang-html prettyprint-override"><code>&lt;body&gt; &lt;h3&gt;Recipes&lt;/h3&gt; {{&gt; recipes}} &lt;/body&gt; &lt;template name="recipes"&gt; &lt;ul&gt; {{#each recipes}} &lt;li&gt;{{name}}&lt;/li&gt; {{/each}} &lt;/ul&gt; &lt;/template&gt; </code></pre> <p><strong>recipes.coffee</strong></p> <pre class="lang-coffeescript prettyprint-override"><code>Recipes = new Meteor.Collection("recipes") if Meteor.is_client Meteor.startup -&gt; Meteor.autosubscribe(-&gt; Meteor.subscribe('recipes') ) # THIS IS NOT WORKING Template.recipes.recipes -&gt; return Recipes.find() if Meteor.is_server Meteor.startup -&gt; if Recipes.find().count() == 0 data = [ name: "Chocolate Chip Cookies" , name: "Spring Rolls" ] for item in data Recipes.insert(item) Meteor.publish('recipes', -&gt; return Recipes.find() ) </code></pre> <p><strong>error</strong></p> <pre class="lang-none prettyprint-override"><code>Uncaught TypeError: Object function (data) { var getHtml = function() { return raw_func(data, { helpers: partial, partials: Meteor._partials }); }; var react_data = { events: (name ? Template[name].events : {}), event_data: data, template_name: name }; return Meteor.ui.chunk(getHtml, react_data); } has no method 'recipes' </code></pre> <p>I've tried this with autopublish and without. What am I not understanding here?</p> <p><strong>Edit:</strong></p> <p>I posted the wrong code before, as Jasd pointed out. The code as it is now is the code in question.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload