Creating the Row Constructor
You cannot create the markup in index.html for the checklist items, because they need to be added after the page has already been rendered, in response to form submissions. Instead, you will add a Row constructor to the CheckList module.
The Row constructor will be in charge of
creating all the DOM elements necessary to represent
a single coffee order, including the checkbox and text description.
But the Row constructor will not be exported to the App
namespace. It will only be used internally by one of the CheckList.prototype
methods.
Add the Row constructor in checklist.js, just before the
App.CheckList = CheckList;
statement. It should accept an
argument called coffeeOrder
that will be the same data ...
Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.