6 SportsStore: orders and checkout
This chapter covers
- Creating a shopping cart
- Using URLs to navigate within the application
- Creating and storing customer orders
- Using a RESTful web service
In this chapter, I continue adding features to the SportsStore application that I created in chapter 5. I add support for a shopping cart and a checkout process and replace the dummy data with the data from the RESTful web service.
6.1 Preparing the example application
No preparation is required for this chapter, which continues using the SportsStore project from chapter 5. To start the RESTful web service, open a command prompt and run the following command in the SportsStore folder:
npm run json
Open a second command prompt and run the following command in the SportsStore folder to start the development tools and HTTP server:
ng serve --open
Tip
You can download the example project for this chapter—and for all the other chapters in this book—from https://github.com/manningbooks/pro-angular-16. See chapter 1 for how to get help if you have problems running the examples.
6.2 Creating the cart
The user needs a cart into which products can be placed and used to start the checkout process. In the sections that follow, I’ll add a cart to the application and integrate it into the store so that the user can select the products they want.