Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AngularPractice2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
李彥志
AngularPractice2
Commits
87da2d5f
Commit
87da2d5f
authored
Jan 10, 2019
by
李彥志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 題三
parent
3b42d864
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
src/app/p3/p3.component.html
src/app/p3/p3.component.html
+6
-6
src/app/p3/p3.component.ts
src/app/p3/p3.component.ts
+7
-5
src/app/p4/p4.component.ts
src/app/p4/p4.component.ts
+1
-1
No files found.
src/app/p3/p3.component.html
View file @
87da2d5f
<p
style=
"color:green"
>
題三
</p>
<!-- 圖片無法顯示QQ -->
寬度 :
<input
type=
"number"
min=
"1"
step=
"5
"
><br>
高度 :
<input
type=
"number"
min=
"1"
step=
"5
"
><br>
<img
src =
"imageUrl"
>
<img
[src]=
" imageUrl "
>
<img
bind-src=
"imageUrl "
>
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 '
/
>
<router-outlet></router-outlet>
src/app/p3/p3.component.ts
View file @
87da2d5f
...
...
@@ -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
=
'
http
s
://lorempixel.com/
'
+
this
.
widthLength
+
'
/
'
+
this
.
heightLength
+
'
/
'
;
}
else
{
alert
(
'
長度或高度不得為空!
'
);
alert
(
'
null
'
);
}
}
constructor
()
{
}
ngOnInit
()
{
}
}
src/app/p4/p4.component.ts
View file @
87da2d5f
...
...
@@ -49,7 +49,7 @@ export class P4Component implements OnInit {
if
(
this
.
value2
!==
Number
)
{
alert
(
'
只能輸入數字
'
);
alert
(
'
欄位只能輸入英文兩碼 + 數字三碼
'
);
}
else
{
alert
(
'
輸入正確
'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment