learn-co-students / javascript-handlebars-templates-lab-v-000 Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
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:
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:
Suggested instructions
PART I:
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()
.recipe-template
. This template should contain the recipe name. description, list of ingredients and an "Edit Recipe" link.displayEditForm()
function that renders a template called recipe-form-template
.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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.