My Blog

My WordPress Blog

My Blog

My WordPress Blog

Basic Concepts

**1. Blaze Templating: Meteor comes with its own templating system called Blaze. Here’s an example of a simple Blaze template:

<head>
  <title>My First Meteor App</title>
</head>

<body>
  <h1>{{header}}</h1>
  {{> myForm}}
</body>

<template name="myForm">
  <form class="my-form">
&lt;input type="text" name="textField" placeholder="Type something">
&lt;button type="submit">Submit&lt;/button>
</form> </template>

**2. Collections: Collections are a way to manage and store data. Here’s how to define a new collection:

// In a file within the imports/ directory

import { Mongo } from 'meteor/mongo';

export const Items = new Mongo.Collection('items');

**3. Publications and Subscriptions: To manage data flow between the server and client, you use publications and subscriptions.

Server Side:

Meteor.publish('items', function () {
  return Items.find();
});

Client Side:

Meteor.subscribe('items');
Basic Concepts

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top