1
以下のコードは、すべて私の項目の数量が表示されていない私のfirebaseデータベースをループされていない、それだけで最初の項目私のコードは
import {ShoppingCartItem} from './shopping-cart-item';
export class ShoppingCart {
constructor(public items: ShoppingCartItem[]) {}
get totalItemsCount() {
let count = 0;
for (const productId in this.items) {
if (this.items.hasOwnProperty(productId)) {
count += this.items[productId].quantity;
return count;
}
}
}
}