Cart & Checkout — Facts

Overview

Standalone CartComponent (route /cart). Three template states: order placed, empty cart, and the line-item table (@if placed / @else if empty / @else table).

Component tree

Single component, no children. Uses RouterLink + CurrencyPipe. A local placed signal flips the view after checkout.

Data flow

Routes & params

/cart — no params.

Key files

RoleFile
Componentapp/src/app/pages/cart/cart.component.ts
Template…/cart.component.html
Styles…/cart.component.scss
Cart stateapp/src/app/services/cart.service.ts
Modelsapp/src/app/models/cart-item.ts, …/book.ts

Gotchas

[[book-detail]] + [[book-list]] (both write to the same CartService).