Question 1 / 1
A ProductCardComponent is used in three places: a product list page, a search results page, and a recommendations widget. A developer adds @Inject(AppStore) to its constructor to dispatch a [Cart] Add Item action when the user clicks 'Add to Cart'. What problem does this create?
typescript @Component({ selector: 'app-product-card' }) export class ProductCardComponent { @Input() product: Product;
constructor(@Inject(AppStore) private store: Store<AppState>) {}
addToCart(): void { this.store.dispatch(addToCart(this.product)); } }