diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 5acc7ff5346f62833364a40058b7a1400fe61df8..cb1276771ac75c23622e963d7d591a6a95056f5c 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -94,7 +94,7 @@ cnt:
{{ item2.description }} - + {{ item.speed }} meter/sec diff --git a/src/app/p2/p2.component.ts b/src/app/p2/p2.component.ts index 8e555f9dc4ef08b85a44ab8b85f8dee4937d956f..7ab1980027ec2e7976c8faaa5890f68859deca0d 100644 --- a/src/app/p2/p2.component.ts +++ b/src/app/p2/p2.component.ts @@ -16,7 +16,7 @@ export class P2Component implements OnInit { datas: Data[] = []; - // result = 0; + result: any; total: any; message = ''; @@ -49,13 +49,12 @@ export class P2Component implements OnInit { } totalPrice(): void { - const result = 0; for ( const i = 0; i < this.datas.length; i++ - ) { const data = this.datas[i]; - result = result + data.total; + ) { const data = this.datas; + this.result = this.result + data[i].total; } - return result; + return this.result; } deleteItem(name, i): void { diff --git a/src/app/p3/p3.component.html b/src/app/p3/p3.component.html index a4ccb75c5ef328241aa5b18c071ba58d232fe192..ecf06290038db69ce05a18932630d66c941bff66 100644 --- a/src/app/p3/p3.component.html +++ b/src/app/p3/p3.component.html @@ -1,10 +1,12 @@

題三

- - WidthLength :
- HeightLength :
+

+ WidthLength :
+ HeightLength :
- +