About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Meteor

Similar documents
This tutorial has been prepared for beginners to help them understand the basic functionalities of Gulp.

This tutorial is designed for software programmers who would like to learn the basics of ASP.NET Core from scratch.

In this tutorial, we are going to learn how to use the various features available in Flexbox.

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Django

This is an introductory tutorial designed for beginners to help them understand the basics of Radius.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer ASP.NET WP

This is a brief tutorial that explains how to make use of Sqoop in Hadoop ecosystem.

Scalable Vector Graphics commonly known as SVG is a XML based format to draw vector images. It is used to draw twodimentional vector images.

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. TurboGears

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. RichFaces

This tutorial has been prepared for beginners to help them understand the simple but effective SEO characteristics.

This tutorial also elaborates on other related methodologies like Agile, RAD and Prototyping.

So, this tutorial is divided into various chapters and describes the 5G technology, its applications, challenges, etc., in detail.

This tutorial will guide users on how to utilize TestLodge in reporting and maintaining the testing activities.

This tutorial is prepared for beginners to help them understand the basic-to-advanced concepts related to GPRS.

About the Tutorial. Audience. Prerequisites. Copyright and Disclaimer. PySpark

Before you start with this tutorial, you need to know basic Java programming.

This tutorial will help you understand JSON and its use within various programming languages such as PHP, PERL, Python, Ruby, Java, etc.

This tutorial will show you, how to use RSpec to test your code when building applications with Ruby.

This tutorial is designed for all Java enthusiasts who want to learn document type detection and content extraction using Apache Tika.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Laravel

This tutorial explains the key concepts of Web Dynpro with relevant screenshots for better understanding.

Before you start proceeding with this tutorial, we are assuming that you are already aware about the basics of Web development.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Haskell Programming

This tutorial will give you a quick start with Consul and make you comfortable with its various components.

This tutorial discusses the basics of PouchDB along with relevant examples for easy understanding.

Testing is the process of evaluating a system or its component(s) with the intent to find whether it satisfies the specified requirements or not.

This tutorial provides a basic understanding of how to generate professional reports using Pentaho Report Designer.

This tutorial introduces you to key DynamoDB concepts necessary for creating and deploying a highly-scalable and performance-focused database.

You must have a basic understanding of GNU/Linux operating system and shell scripting.

Memcached is an open source, high-performance, distributed memory object caching system.

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright DAX

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Joomla

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Jenkins

This is a small tutorial where we will cover all the basic steps needed to start with Balsamiq Mockups.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Drupal

This tutorial provides a basic level understanding of the LOLCODE programming language.

Before proceeding with this tutorial, you should have a good understanding of the fundamental concepts of marketing.

About the Tutorial. Audience. Prerequisites. Copyright and Disclaimer. Logstash

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. WordPress

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Graph Theory

SAP Lumira is known as a visual intelligence tool that is used to visualize data and create stories to provide graphical details of the data.

This tutorial provides a basic understanding of the infrastructure and fundamental concepts of managing an infrastructure using Chef.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

This tutorial is designed for those who would like to understand the basics of i-mode in simple and easy steps.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

This tutorial will take you through simple and practical approaches while learning AOP framework provided by Spring.

This tutorial will help you in understanding IPv4 and its associated terminologies along with appropriate references and examples.

This tutorial explains how you can use Gradle as a build automation tool for Java as well as Groovy projects.

This tutorial has been designed for beginners interested in learning the basic concepts of UDDI.

This tutorial is intended to make you comfortable in getting started with the Firebase backend platform and its various functions.

Microsoft Excel is a spreadsheet tool capable of performing calculations, analyzing data and integrating information from different programs.

This tutorial will teach you how to use Java Servlets to develop your web based applications in simple and easy steps.

This tutorial is meant for software developers who want to learn how to lose less time on API integrations!

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer DBMS

You should have a basic understanding of Relational concepts and basic SQL. It will be good if you have worked with any other RDBMS product.

In this tutorial, we will discuss the architecture, pin diagram and other key concepts of microprocessors.

Parrot is a virtual machine designed to efficiently compile and execute bytecode for interpreted languages.

This is an introductory tutorial, which covers the basics of Jython and explains how to handle its various modules and sub-modules.

Before proceeding with this tutorial, you must have a good understanding of Core Java and any of the Linux flavors.

jmeter is an open source testing software. It is 100% pure Java application for load and performance testing.

This is a simple tutorial that covers the basics of SAP Business Intelligence and how to handle its various other components.

In this brief tutorial, we will be explaining the basics of Elasticsearch and its features.

Adobe Flex Tutorial i

<link rel="stylesheet" href="

This tutorial covers a foundational understanding of IPC. Each of the chapters contain related topics with simple and useful examples.

This tutorial has been designed to help beginners understand the basic concepts of WiMAX.

This tutorial helps the professionals aspiring to make a career in Big Data and NoSQL databases, especially the documents store.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. HCatalog

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright CICS

WebGL (Web Graphics Library) is the new standard for 3D graphics on the Web, designed for rendering 2D graphics and interactive 3D graphics.

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design

20486-Developing ASP.NET MVC 4 Web Applications

..or a tale on how to build a rocket with a meteor

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Gerrit

Dart is an open-source general-purpose programming language. It is originally developed by Google and later approved as a standard by ECMA.

This tutorial has been prepared for computer science graduates to help them understand the basic-to-advanced concepts related to data mining.

About Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Euphoria

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

20486: Developing ASP.NET MVC 4 Web Applications

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics

This tutorial is designed for software developers who want to learn how to develop quality applications with clean structure of code.

GETTING STARTED WITH METEOR.JS JAVASCRIPT FRAMEWORK - SECOND EDITION BY ISAAC STRACK

In mainframe environment, programs can be executed in batch and online modes. JCL is used for submitting a program for execution in batch mode.

Developing ASP.NET MVC 4 Web Applications

This tutorial will help computer science graduates to understand the basic-to-advanced concepts related to data warehousing.

Leaflet.js is an open-source library using which we can deploy interactive, simple, lightweight and simple web maps.

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Avro

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Apache Bench

Cognos also provides you an option to export the report in XML or PDF format or you can view the reports in XML format.

COURSE 20486B: DEVELOPING ASP.NET MVC 4 WEB APPLICATIONS

20486: Developing ASP.NET MVC 4 Web Applications (5 Days)

This tutorial covers most of the topics required for a basic understanding of KnockoutJS and explains its various functionalities.

Developing ASP.NET MVC 4 Web Applications

Getting Started with Meteor

welcome to BOILERCAMP HOW TO WEB DEV

Try the following example using the Try it option available at the top right corner of the below sample code box

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Salesforce

Introduction to AngularJS

Visual Studio Course Developing ASP.NET MVC 5 Web Applications

Transcription:

About the Tutorial Meteor is a full-stack JavaScript platform for building web and mobile apps. Meteor makes it easier to create real-time apps, since it alone offers a full ecosystem to work with, instead of combining couple of different tools and frameworks to get the same effect. Audience This tutorial will be useful for any JavaScript developer who wants to learn Meteor framework. The tutorial is explained in a crisp manner with simple and easy-to-grasp code samples. Beginners will benefit the most from this tutorial. Readers can also use it as a reference while working with Meteor framework. Prerequisites Meteor is a JavaScript framework, hence readers will need to have basic knowledge of JavaScript and HTML. They will also need to be familiar with NodeJS and MongoDB although it will also be easy to understand everything without previous knowledge. If the readers have never used MongoDB, any knowledge about databases should suffice. Since Meteor is a full-stack framework, any previous experience in creating web or mobile apps will be helpful. Copyright & Disclaimer Copyright 2018 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at contact@tutorialspoint.com i

Table of Contents About the Tutorial... i Audience... i Prerequisites... i Copyright & Disclaimer... i Table of Contents... ii 1. METEOR OVERVIEW... 1 2. METEOR ENVIRONMENT SETUP... 2 3. METEOR FIRST APPLICATION... 3 4. METEOR TEMPLATES... 4 Simple Template... 4 Block Template... 5 5. METEOR COLLECTIONS... 7 Create a Collection... 7 Add Data... 7 Find Data... 7 Update Data... 9 Delete Data... 10 6. METEOR FORMS... 13 Text Input... 13 Radio Buttons... 14 Checkbox... 16 Select Dropdown... 17 7. METEOR EVENTS... 19 ii

8. METEOR SESSION... 21 9. METEOR TRACKER... 23 10. METEOR PACKAGES... 25 Adding Packages... 25 Removing Packages... 25 Updating Packages... 25 Checking Current Packages... 25 Package Maintenance... 25 11. METEOR CORE API... 26 12. METEOR CHECK... 27 Installing Check Package... 27 Using Check... 27 Match Test... 27 13. METEOR BLAZE... 29 Render Method... 29 Render with Data... 30 Remove Method... 31 14. METEOR TIMERS... 34 Timeout... 34 Interval... 35 15. METEOR EJSON... 37 Install EJSON... 37 Stringify... 38 iii

16. METEOR HTTP... 40 Install Package... 40 CALL Method... 40 GET Method... 40 POST Method... 41 PUT Method... 42 DEL Method... 42 17. METEOR EMAIL... 44 18. METEOR ASSETS... 45 19. METEOR SECURITY... 47 Autopublish and Autosecure... 47 Use Server Side Methods... 47 Additional Security... 47 20. METEOR SORTING... 48 21. METEOR ACCOUNTS... 52 Authentication Example... 52 22. METEOR METHODS... 57 Using Methods... 57 Handling Errors... 58 23. METEOR PACKAGE.JS... 60 Creating a Package... 60 Adding a Package... 60 Package Files... 60 Testing Package (package-name-test.js)... 61 iv

package.js File... 62 package-name.js File... 62 Using a Package... 63 24. METEOR PUBLISH & SUBSCRIBE... 65 Removing Autopublish... 65 Using Publish and Subscribe... 66 Filtering Client Data... 67 25. METEOR STRUCTURE... 69 26. METEOR DEPLOYMENT... 70 27. METEOR RUNNING ON MOBILE... 71 28. METEOR TODO APP... 73 29. METEOR BEST PRACTICES... 78 v

1. Meteor Overview Meteor According to Meteor official documentation Meteor is a full-stack JavaScript platform for developing modern web and mobile applications. Meteor includes a key set of technologies for building connected-client reactive applications, a build tool, and a curated set of packages from the Node.js and general JavaScript community. Features Web and Mobile Meteor offers a platform for developing Web, Android, and IOS apps. Universal Apps The same code for web browsers and mobile devices. Packages Huge number of packages that are easy to install and use. Meteor Galaxy Cloud service for Meteor app deployment. Advantages Limitations Developers only need JavaScript for server and client side development. Coding is very simple and beginner friendly. Meteor apps are real time by default. Official and community packages are huge time saver. Meteor isn't very suitable for large and complex applications. There is a lot of magic going on when working with Meteor, so developers might find themselves limited in some way. 1

2. Meteor Environment Setup Meteor In this chapter, we will learn how to install Meteor on Windows operating system. Before we start working with Meteor, we will need NodeJS. If you don't have it installed, you can check the links provided below. Prerequisite NodeJS is the platform needed for Meteor development. If you do not have NodeJS environment setup ready, then you can check out our NodeJS Environment Setup. Install Meteor Download the official meteor installer from this page. If any error occurs during the installation, try running the installer as an administrator. Once the installation is complete, you will be asked to create a Meteor account. When you finish installing Meteor installer, you can test if everything is installed correctly by running the following code in the command prompt window. C:\Users\username>meteor Following will be the output 2

3. Meteor First Application Meteor In this chapter, we will learn how to create your first Meteor application. Step 1 - Create the App To create the app, we will run the meteor create command from the command prompt window. The apps name will be meteorapp. C:\Users\username\Desktop\Meteor>meteor create meteorapp Step 2 - Run the App We can run the app by typing the meteor command. C:\Users\username\Desktop\meteorApp>meteor This command will start several processes, which can be seen in the following image. Step 3 - Verify the Result Now, we can open the http://localhost:3000/ address to see how our first Meteor App looks like. 3

4. Meteor Templates Meteor Meteor templates are using three top level tags. The first two are head and body. These tags perform the same functions as in regular HTML. The third tag is template. This is the place, where we connect HTML to JavaScript. Simple Template Following example shows how this works. We are creating a template with name = "myparagraph" attribute. Our template tag is created below the body element, however, we need to include it before it is rendered on the screen. We can do it by using {{> myparagraph}} syntax. In our template, we are using double curly braces ({{text}}). This is meteor template language called Spacebars. In our JavaScript file, we are setting Template.myParagraph.helpers({}) method that will be our connection to our template. We are only using text helper in this example. meteorapp.html <head> <title>meteorapp</title> </head> <body> <h1>header</h1> {{> myparagraph}} </body> <template name = "myparagraph"> <p>{{text}}</p> </template> meteorapp.js if (Meteor.isClient) { // This code only runs on the client Template.myParagraph.helpers({ text: 'This is paragraph...' }); } 4

After we save the changes, following will be the output Block Template In the following example, we are using {{#each paragraphs}} to iterate over the paragraphs array and return template name = "paragraph" for each value. meteorapp.html <head> <title>meteorapp</title> </head> <body> <div> {{#each paragraphs}} {{> paragraph}} {{/each}} </div> </body> <template name = "paragraph"> <p>{{text}}</p> </template> We need to create paragraphs helper. This will be an array with five text values. 5

meteorapp.js if (Meteor.isClient) { // This code only runs on the client Template.body.helpers({ paragraphs: [ { text: "This is paragraph 1..." }, { text: "This is paragraph 2..." }, { text: "This is paragraph 3..." }, { text: "This is paragraph 4..." }, { text: "This is paragraph 5..." } ] }); } Now, we can see five paragraphs on the screen. 6

End of ebook preview If you liked what you saw Buy it from our store @ https://store.tutorialspoint.com 7