Adding a product

The third feature of this application is about adding a product to the products grid. To implement this feature, we will:

  • Update the products client module to add a method to send a request to the server to add a new product
  • Update the product model to add a flag to switch the product between edit and display mode
  • Update the products grid module to create a method to add a product
  • Update the products grid module to create a method to save the product
  • Update the view to create a link to add a product and capture user input

Let's get started by updating the ProductsClient module. Open the ProductsClient module in the productsclient.js file and add a method to send HTTP POST request to http://[host:port]/products. The method should expect ...

Get KnockoutJS by Example 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.