E44: Digits, Part 3

For this experience, you begin to “wire up” your Digits mockup so that the pages have the correct behavior.

As with the last WOD, feel free to watch me solve it first, and then try it yourself.

Before starting this WOD, be sure to have merged the branch containing the “final” version of your previous WOD into master. See the screencast in the Readings for an illustration.

Note that switching branches on a running meteor application has the potential to put the application into an inconsistent state. To minimize problems, whenever you switch branches while doing meteor development, it is best to:

  1. Quit meteor.
  2. Invoke meteor reset to clear out the contents of the database.
  3. Re-invoke meteor. For applications based upon meteor-application-template, the correct invocation is meteor --settings ../config/settings.development.json.

The WOD

Ready? Let’s begin:

  1. Start your timer.

  2. Create and switch to a branch called “home-page-1” in your local repository. You will do all the work for this WOD in this branch.

  3. Create a Contacts collection. Create a contacts.js file in imports/api/contacts that defines the Contacts collection to hold contact data. Note you’ll also have to create an index.js file in that new directory, and you’ll need to update both client/main.js and server/main.js to import that file. Delete the autoform key and values from the SimpleSchema since we’re not using AutoForm.

  4. Create sample Contacts data. Create a contacts.js file in imports/startup/server to create appropriate sample data for the collection upon startup.

  5. Show Contacts data in home page. Edit the home page to display the sample data from the collection. Use the List Stuff pages as a guide. You’ll need to create a home-page.js file among other things.

  6. Once you’ve finished, commit your changes to GitHub, and check to see that your changes are there.

  7. Stop your timer and record your time. Be sure to record it, because you will need your WOD time data when you write your technical essay.

Rx: <16 min Av: 16-20 min Sd: 20-25 min DNF: 25+ min

Demonstration

You can watch this before doing the WOD if you like:

If you want to try this WOD again, just commit your branch, then switch to the master branch to reset your system to its state at the end of the first Digits experience. Then create a new branch called home-page-2 and start over.

Submission instructions

By the time and date indicated on the Schedule page, submit this assignment via Laulima.

Your submission should contain:

You will receive full credit for this practice WOD as long as you have attempted it at least once and submitted the email with all required data before the due date. Your code does not have to run perfectly for you to receive full credit. However, if you do not repeat each practice WOD until you can finish it successfully in at least AV time, you are unlikely to do well on the in-class WOD. To reduce the stress associated with this course, I recommend that you repeat each practice WOD as many times as necessary to achieve at least AV before its due date.