Add Items to Our Cart

Learn how to make our cart functional.

Add items

We have a front-end that connects to our ShoppingCartChannel with an empty shopping cart—this is not very exciting. To see the cart on-screen, we have to place an item in it. Let’s set up the front-end to add an item to our cart when we click on it. We’ll start with what we want our app.js to look like, then we’ll implement the functions we need.

Add this function after the call to Cart.setupCartChannel.

Get hands-on with 1000+ tech skills courses.