diff --git a/src/app/shop/shop.component.html b/src/app/shop/shop.component.html index 61ddad4..290a52b 100644 --- a/src/app/shop/shop.component.html +++ b/src/app/shop/shop.component.html @@ -22,53 +22,11 @@ limitations under the License. Fillings - + + + {{ flavor }} + + diff --git a/src/app/shop/shop.component.scss b/src/app/shop/shop.component.scss index 32752b4..654bd6a 100644 --- a/src/app/shop/shop.component.scss +++ b/src/app/shop/shop.component.scss @@ -62,15 +62,6 @@ flex-grow: 1; // TODO: #7. Create selectable controls with Angular Material - ul { - list-style: none; - margin: 5px 20px; - padding: 0; - } - - li { - margin: 10px 0; - } } .quantity { diff --git a/src/app/shop/shop.component.ts b/src/app/shop/shop.component.ts index 386f412..7b12105 100644 --- a/src/app/shop/shop.component.ts +++ b/src/app/shop/shop.component.ts @@ -25,12 +25,8 @@ export class ShopComponent implements OnInit { color = 'gold'; // TODO: #7. Create selectable controls with Angular Material - fillings = { - bokchoy: true, - tofu: true, - chicken: false, - impossible: false, - }; + fillings: string[] = ['Bok Choy & Chili Crunch', 'Tofu & Mushroom', 'Chicken & Ginger', 'Impossible Meat & Spinach']; + selectedFillings: string[] = []; // TODO: #11. Announce changes with LiveAnnouncer constructor() { } @@ -49,10 +45,9 @@ export class ShopComponent implements OnInit { let flavor = ''; // TODO: #7. Create selectable controls with Angular Material - if (this.fillings.bokchoy) { flavor += 'Bok Choy '; } - if (this.fillings.tofu) { flavor += 'Tofu & Mushroom '; } - if (this.fillings.chicken) { flavor += 'Chicken & Ginger '; } - if (this.fillings.impossible) { flavor += 'Impossible Meat '; } + this.selectedFillings.forEach(filling => { + flavor = flavor + ' ' + filling; + }); const fakePurchase = `Purchase ${this.quantity} ${flavor}dumplings in the color ${this.color}!`; console.log(fakePurchase);