O'Reilly logo

KnockoutJS by Example by Adnan Jaswal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required