Saving Data with a Form
Itâs great that our application is able to list bundles that already exist, but what about adding new ones? The right tool for this job is the venerable HTML <form> tag. Using a form, we can capture user input and process it by making a proxied call to the back-end APIs. Since the form is static HTML, weâll put it in app/templates.ts. Open that file now and add this template.
â | âexportâ âconstâ addBundleForm = Handlebars.compile(â`â |
â | â <div class="panel panel-default">â |
â | â <div class="panel-heading">Create a new bundle.</div>â |
â | â <div class="panel-body">â |
â | â <form>â |
â | â <div class="input-group">â |
â | â <input class="form-control" placeholder="Bundle ... |
Get Node.js 8 the Right Way 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.