diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index a6e014d901acee98914c034693e059b06ae17e8d..5acc7ff5346f62833364a40058b7a1400fe61df8 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -53,7 +53,7 @@ cnt:
icon - + @@ -94,7 +94,7 @@ cnt:
{{ item2.description }} - {{ pic }} + {{ item.speed }} meter/sec @@ -113,7 +113,7 @@ cnt:
- + 單品:
單價:
diff --git a/src/app/p3/imageUrl b/src/app/p3/imageUrl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/p3/p3.component.html b/src/app/p3/p3.component.html index 833a04a276a4eab8d28beb1958dc68db48025d01..cfb6327d06b63112274226735e17d2b1c0af97d9 100644 --- a/src/app/p3/p3.component.html +++ b/src/app/p3/p3.component.html @@ -1,6 +1,10 @@

題三

- 寬度 :
- 高度 :
- + + 寬度 :
+ 高度 :
+ + + + diff --git a/src/app/p3/p3.component.ts b/src/app/p3/p3.component.ts index 269bcefcb8d276cebb58e677cad1da4dfdadea8e..aada6a6d58467fb1ac025c7349832383715b3169 100644 --- a/src/app/p3/p3.component.ts +++ b/src/app/p3/p3.component.ts @@ -9,14 +9,14 @@ export class P3Component implements OnInit { widthLength = '1024'; heightLength = '768'; - imageUrl = 'http://lorempixel.com//{{widthLength}}/{{heightLength}}/'; + imageUrl = 'http://lorempixel.com/{{widthLength}}/{{heightLength}}/'; showPic() { if (this.widthLength !== null && this.heightLength !== null && this.widthLength !== undefined && this.heightLength !== undefined) { - this.imageUrl = "http://lorempixel.com/" + this.widthLength + "/" + this.heightLength + "/"; + this.imageUrl = 'http://lorempixel.com/' + this.widthLength + '/' + this.heightLength + '/'; } else { - alert("長度或高度不得為空!"); + alert('長度或高度不得為空!'); } } diff --git a/src/app/p4/p4.component.html b/src/app/p4/p4.component.html index 43b6b25ccc525eee1367f90afec9af8e0dcb6e23..ed4a3771f29b83994fd0f82abcc71b80743b7796 100644 --- a/src/app/p4/p4.component.html +++ b/src/app/p4/p4.component.html @@ -5,7 +5,7 @@ 一.必須輸入大於0,若輸入小於或等於0,則alert訊息
二.只能輸入數字,若輸入欄位不符,則alert訊息
三.只能輸入英文兩碼+數字三碼,若輸入欄位不符,則alert訊息 - +
欄位一 : 0 ) { - alert('good'); + alert('輸入正確'); } else { - alert('請輸入0'); + alert('請輸入大於0的數字'); } } @@ -34,12 +34,26 @@ export class P4Component implements OnInit { if ( this.value2 !== Number ) { - alert('bye'); + alert('只能輸入數字'); } else { - alert('okay~'); + alert('輸入正確'); } } + addNumber3(inputRef: HTMLInputElement): void { + console.log(inputRef.value); + inputRef.value = ''; + + this.value2 = new Number(inputRef.value); + + if ( + this.value2 !== Number + ) { + alert('只能輸入數字'); + } else { + alert('輸入正確'); + } + } constructor() { }