Hi! I’m stucked at 3rd step of Todo Tutorial. The task that I created through terminal is not showing in the page. TIA!
Meteor version is 1.4.1.2
meteor:PRIMARY> db.tasks.insert({text: "Hello world!", createdAt: new Date() });
WriteResult({ "nInserted" : 1 })
meteor:PRIMARY> db.tasks.find();
{ "_id" : ObjectId("5807de6be7ce83beeb2bb0dd"), "text" : "Hello world!", "createdAt" : ISODate("2016-10-19T20:58:19.130Z") }
// body.js
import { Template } from 'meteor/templating';
import { Tasks } from '../api/tasks.js';
import './body.html';
Template.body.helpers({
tasks() {
return Tasks.find({});
}
});
// main.js
import '../imports/ui/body.js';
import '../imports/api/tasks.js';
// tasks.js
import { Mongo } from 'meteor/mongo';
export const Tasks = new Mongo.Collection('tasks');
<!-- body.html -->
<body>
<div class="container">
<header>
<h1>Todo List</h1>
</header>
<ul>
{{#each tasks}}
{{> task}}
{{/each}}
</ul>
</div>
</body>
<template name="task">
<li>{{text}}</li>
</template>