Commit 055a9508 authored by 李彥志's avatar 李彥志

把totalPrice()稍作修改 解決sever -o 無法display

parent 87da2d5f
...@@ -94,7 +94,7 @@ cnt:<input type="number" min="1" max="7"><br> ...@@ -94,7 +94,7 @@ cnt:<input type="number" min="1" max="7"><br>
{{ item2.description }} {{ item2.description }}
</td> </td>
<td> <td>
<img [src]="pic"> <img [src]='pic'>
</td> </td>
<td> <td>
{{ item.speed }} meter/sec {{ item.speed }} meter/sec
......
...@@ -16,7 +16,7 @@ export class P2Component implements OnInit { ...@@ -16,7 +16,7 @@ export class P2Component implements OnInit {
datas: Data[] = []; datas: Data[] = [];
// result = 0; result: any;
total: any; total: any;
message = ''; message = '';
...@@ -49,13 +49,12 @@ export class P2Component implements OnInit { ...@@ -49,13 +49,12 @@ export class P2Component implements OnInit {
} }
totalPrice(): void { totalPrice(): void {
const result = 0;
for ( for (
const i = 0; i < this.datas.length; i++ const i = 0; i < this.datas.length; i++
) { const data = this.datas[i]; ) { const data = this.datas;
result = result + data.total; this.result = this.result + data[i].total;
} }
return result; return this.result;
} }
deleteItem(name, i): void { deleteItem(name, i): void {
......
<p style="color:green">題三</p> <p style="color:green">題三</p>
<p>
WidthLength : <input type="number" min="1" step="5" [(ngModel)]="widthLength" (change)="showPic()" ><br> WidthLength : <input type="number" min="1" step="5"
HeightLength : <input type="number" min="1" step="5" [(ngModel)]="heightLength" (change)="showPic()"><br> [(ngModel)]="widthLength" (change)="showPic()" ><br>
HeightLength : <input type="number" min="1" step="5"
[(ngModel)]="heightLength" (change)="showPic()"><br>
<img [src]='imageUrl '/> <img [src]='imageUrl '/>
</p>
<router-outlet></router-outlet> <router-outlet></router-outlet>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment