lunes, agosto 10, 2015

Your Second Meteor Application - Extra Exercise 1

In the way of learn Meteor I read several tutorials and books, but two particularly useful were:

After finishing the second book I'm dealing with the addition of some features to the ToDo list application developed during the book, to continue exercising the use of Meteor.

The first thing that I would add is some reference about the logged in  user, in the main page, something as the following picture

As this is shown in the home page, we need to modify the home template (in the todos.html), at this way:

And then, in the todos.js, implement the code to grab the email of the user currently logged, as a home template helper, as shown next:

The rationale behind how to grab the email address is explained in the users collection documentation .
All seems to work ok now, but when no users are logged in, the home page looks messy:

Then we must add a conditional to show the logged user only when a user is logged in. Sound reasonable, right?

I hope that these little examples may be of help to people learning Meteor.

The github repo of the application is here and the deployed application is here.