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>
{{ item2.description }}
</td>
<td>
<img [src]="pic">
<img [src]='pic'>
</td>
<td>
{{ item.speed }} meter/sec
......
......@@ -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 {
......
<p style="color:green">題三</p>
WidthLength : <input type="number" min="1" step="5" [(ngModel)]="widthLength" (change)="showPic()" ><br>
HeightLength : <input type="number" min="1" step="5" [(ngModel)]="heightLength" (change)="showPic()"><br>
<p>
WidthLength : <input type="number" min="1" step="5"
[(ngModel)]="widthLength" (change)="showPic()" ><br>
HeightLength : <input type="number" min="1" step="5"
[(ngModel)]="heightLength" (change)="showPic()"><br>
<img [src]='imageUrl '/>
</p>
<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