From 7e676cc098209c81484f168a243381bd54cc59a2 Mon Sep 17 00:00:00 2001 From: Nadav Mary Date: Mon, 5 Mar 2018 19:45:57 +0200 Subject: [PATCH] nadavs changes for lecture --- package.json | 9 +++-- src/app/components/top/top.component.ts | 2 +- src/app/containers/cart/cart.component.ts | 40 +++++++++++-------- .../order-details/order-details.component.ts | 9 ++++- 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 534886b..9185736 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,11 @@ "scripts": { "ng": "ng", "start": "concurrently --kill-others \"npm run application\" \"npm run server\"", - "application": "ng serve", + "application": "ng serve --aot", "server": "nodemon server.js", - "build": "ng build --prod", + "build": "ng build --prod --aot", + "build-with-stats": "ng build --prod --aot --stats-json", + "bundle-report": "webpack-bundle-analyzer dist/stats.json", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" @@ -54,6 +56,7 @@ "protractor": "~5.1.2", "ts-node": "~4.1.0", "tslint": "~5.9.1", - "typescript": "~2.5.3" + "typescript": "~2.5.3", + "webpack-bundle-analyzer": "^2.11.1" } } diff --git a/src/app/components/top/top.component.ts b/src/app/components/top/top.component.ts index 55e66bb..8cc9725 100644 --- a/src/app/components/top/top.component.ts +++ b/src/app/components/top/top.component.ts @@ -23,7 +23,7 @@ import { AutoUnsubscribe } from "ngx-auto-unsubscribe"; export class TopComponent implements OnInit, OnDestroy { public cartLabel$: Observable; - private items: MenuItem[]; + public items: MenuItem[]; private cartSubscription: Subscription; constructor(private router: Router, private ngRedux: NgRedux) { } diff --git a/src/app/containers/cart/cart.component.ts b/src/app/containers/cart/cart.component.ts index 41525bf..42b2a94 100644 --- a/src/app/containers/cart/cart.component.ts +++ b/src/app/containers/cart/cart.component.ts @@ -10,26 +10,30 @@ import { IPizzariumState } from '../../app.module'; styleUrls: ['./cart.component.css'], template: ` -
No items in cart
-
-
-
Size: {{ order.selectedPizza.value }} - {{ order.selectedPizza.extraData.price }}₪
-
-
Toppings:
-
- - {{selectedTopping.extraData.price}}₪ + +
+
+
Size: {{ order.selectedPizza.value }} - {{ order.selectedPizza.price }}₪
+
+
Toppings:
+
+ - {{selectedTopping.price}}₪ +
+
+ + No toppings selected. + +
+
Total: {{ order.getTotalPrice() }}₪
+
-
-
- No toppings selected. -
-
-
Total: {{ order.getTotalPrice() }}₪
-
-
-

Total price: {{ totalPrice$ | async }}₪

+ + No items in cart + +

Total price: {{ totalPrice$ | async }}₪

+