Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Getting Started with Meteor.js JavaScript Framework - Second Edition
  • Table Of Contents Toc
  • Feedback & Rating feedback
Getting Started with Meteor.js JavaScript Framework - Second Edition

Getting Started with Meteor.js JavaScript Framework - Second Edition

By : Isaac Strack
4.2 (5)
close
close
Getting Started with Meteor.js JavaScript Framework - Second Edition

Getting Started with Meteor.js JavaScript Framework - Second Edition

4.2 (5)
By: Isaac Strack

Overview of this book

This book is for developers or students who have a working knowledge of JavaScript and HTML, and want to learn how to quickly develop full-stack web applications using pure JavaScript.
Table of Contents (14 chapters)
close
close

Let's create some templates


We'll now see a real-life example of reactive computations and work on our Lending Library at the same time. Adding categories through the console has been a fun exercise, but it's not a long-term solution. Let's make it so that we can do that on the page instead as follows:

  1. Open LendLib.html and add a new button just before the {{#each lists}} expression:

    <div id="categories" class="btn-group">
      <div class="category btn btn-primary" id="btnNewCat">
        <span class="glyphicon glyphicon-plus"></span>
      </div>
      {{#each lists}}
  2. This will add a plus button on the page, as follows:

  3. Now, we want to change the button into a text field when we click on it. So let's build that functionality by using the reactive pattern. We will make it based on the value of a variable in the template.

  4. Add the following {{#if…else}} conditionals around our new button:

    <div id="categories" class="btn-group">
      {{#if new_cat}}
      {{else}}
        <div class...

Limited Time Offer

$10p/m for 3 months

Get online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech and supported with AI assistants
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon

Create a Note

Modal Close icon
You need to login to use this feature.

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note