Hiding cart if empty
Looking at the completed version of the store, there's a pretty cool feature in here, where if the shopping cart is empty, it says no items in the cart.
Then, when we add an item to the cart, that text disappears and instead we see the content of the cart, and the total.
To achieve this, let's add another div below the total, and in this one, we'll put the text "No items in the cart.".
<div>
<div>Total: {{ total }}</div>
</div>
<div>
Click to load comments...