In the previous chapter, we created an Angular application and built our first signal-powered service to manage the product catalog. That was just the beginning. In this chapter, we introduce the shopping cart, define a model for cart items, and implement a dedicated service to manage it. We’ll also begin deriving useful reactive state using computed(), things like item count and total cost.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Modeling Product and Cart State with Signals

  • Sonu Kapoor

摘要

In the previous chapter, we created an Angular application and built our first signal-powered service to manage the product catalog. That was just the beginning. In this chapter, we introduce the shopping cart, define a model for cart items, and implement a dedicated service to manage it. We’ll also begin deriving useful reactive state using computed(), things like item count and total cost.