Products
{{ products.value().total }}
Loading products…
} @else if (products.error()) {Could not load products. Refresh to try again.
} @else if (products.hasValue()) {{{ products.value().total }}
{{ inStock() }}
{{ averageRating() }}
| Product | Price | Stock |
|---|---|---|
| {{ product.title }} | {{ product.price | currency }} | {{ product.stock }} |
Loading chart…
} @error {The chart could not be loaded.
} ``` Use real chart data and a chart library only when the project needs one. A table should remain available for users who cannot interpret the visual chart. ## Production considerations - Replace the demo API with your own authenticated API. - Validate and format currency using the right locale. - Add pagination and server-side filtering for large result sets. - Show an explicit empty state when the API returns no products. - Add tests for loading, success and error states with `HttpTestingController`. ## Next steps - [HTTP Client](/beginner/http/) - [Resource API](/modern/resource-api/) - [Component Testing](/testing/component-testing/)