diff --git a/src/app/p3/p3.component.html b/src/app/p3/p3.component.html index cfb6327d06b63112274226735e17d2b1c0af97d9..a4ccb75c5ef328241aa5b18c071ba58d232fe192 100644 --- a/src/app/p3/p3.component.html +++ b/src/app/p3/p3.component.html @@ -1,10 +1,10 @@

題三

- - 寬度 :
- 高度 :
- - - + + WidthLength :
+ HeightLength :
+ + + diff --git a/src/app/p3/p3.component.ts b/src/app/p3/p3.component.ts index aada6a6d58467fb1ac025c7349832383715b3169..91dda1c00d52726e84d5c4e3ac2098612fbb1f8e 100644 --- a/src/app/p3/p3.component.ts +++ b/src/app/p3/p3.component.ts @@ -9,19 +9,21 @@ export class P3Component implements OnInit { widthLength = '1024'; heightLength = '768'; - imageUrl = 'http://lorempixel.com/{{widthLength}}/{{heightLength}}/'; + imageUrl = null; + + ngOnInit() { + this.showPic(); + } 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 = 'https://lorempixel.com/' + this.widthLength + '/' + this.heightLength + '/'; } else { - alert('長度或高度不得為空!'); + alert('null'); } } constructor() { } - ngOnInit() { } - } diff --git a/src/app/p4/p4.component.ts b/src/app/p4/p4.component.ts index 4b006c330ca133ef74dd4073f1011da6dd920373..a1ff63bfc2fbe2c532bbfd83338f6fe732741844 100644 --- a/src/app/p4/p4.component.ts +++ b/src/app/p4/p4.component.ts @@ -49,7 +49,7 @@ export class P4Component implements OnInit { if ( this.value2 !== Number ) { - alert('只能輸入數字'); + alert('欄位只能輸入英文兩碼 + 數字三碼'); } else { alert('輸入正確'); }