Git Product home page Git Product logo

javascript-handlebars-templates-lab-v-000's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javascript-handlebars-templates-lab-v-000's Issues

Lab instruction improvement: suggestions

Hi Learn team,

I just went to a study group for this Lab, and we found the instructions for this lab to be quite confusing...

Currently, the lab covers multiple concepts:

  • Handlebar templates
  • Register and use Helpers
    • Each, If, and custom helpers
  • Register and use Partials

In the 6-step lab, students are asked to nest helpers within partials within handlebar templates, the current instructions are not linear and required a lot of jumping back-and-forth and refactoring (templates into partials, partials into helpers) on the fly.

Perhaps it will make sense to split the lab up into 2 labs? Or extend instructions with more steps:

  • Complete a working app complete with forms to create & edit recipes
  • Start with plain Handlebar templates
  • Refactor sections of code into partials
  • Refactor partials into helpers where possible

Suggested instructions
PART I:

  1. Create a form template with an id of recipe-form-template that will be used to enter new recipes. Make the form submit with a createRecipe() function. Provide inputs for recipe name, description, and at least five ingredients. Hint: Get comfy collecting values with getElementsByName().
  2. Create a template with an id of recipe-template. This template should contain the recipe name. description, list of ingredients and an "Edit Recipe" link.
  3. Render this template with the recipe data when the user submits the form.
  4. On click of your "Edit Recipe" link, call a displayEditForm() function that renders a template called recipe-form-template.
  5. Allow your recipe to be edited using this form, and re-render the recipe template with the updated information using a updateRecipe() function on form submit.

PART II:
6. Refactor your forms so that recipe-form and the edit form template are both constructed with the same recipe-form-template. The template should render with the recipe data for edit, and with empty values for a new recipe. Hint: Don't forget you can pass any object with any properties as the context for your templates, including, for instance, values for onsubmit.
7. Refactor recipe-template by registering a partial called recipeDetailsPartial. Create a template with an id of recipe-details-partial to hold the markup. Use the each helper to display the collection of ingredients.
8. Refactor recipeDetailsPartial by registering a custom helper called displayIngredient to display each ingredient within the each block.

Thanks!
Lisa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.