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
555c96b6
Commit
555c96b6
authored
Jan 11, 2019
by
李彥志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增練習三的stackblitz連結
parent
055a9508
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
src/app/p2/p2.component.html
src/app/p2/p2.component.html
+3
-3
src/app/p2/p2.component.ts
src/app/p2/p2.component.ts
+5
-4
src/app/p3/p3.component.html
src/app/p3/p3.component.html
+8
-2
No files found.
src/app/p2/p2.component.html
View file @
555c96b6
...
...
@@ -5,9 +5,9 @@
問題2、在component.ts設定的buildMessage之訊息無法秀出
-->
單品:
<input
type=
"text"
name=
"name"
[(ngModel)]=
"name"
(change)=
"bulidMessage()"
><br>
單價:
<input
type=
"number"
name=
"price"
min=
"1"
[(ngModel)]=
"price"
(change)=
"bulidMessage()"
><br>
數量:
<input
type=
"number"
name=
"quantity"
min=
"1"
[(ngModel)]=
"quantity"
(change)=
"bulidMessage()"
><br>
單品:
<input
type=
"text"
name=
"name"
[(ngModel)]=
"name"
><br>
單價:
<input
type=
"number"
name=
"price"
min=
"1"
[(ngModel)]=
"price"
><br>
數量:
<input
type=
"number"
name=
"quantity"
min=
"1"
[(ngModel)]=
"quantity"
><br>
<p
[hidden]=
"name == 0"
>
你購買 {{ name }} 商品,單價 {{ price }} 元,數量{{ quantity }}元,共計NT${{ price * quantity}} 元
...
...
src/app/p2/p2.component.ts
View file @
555c96b6
...
...
@@ -16,7 +16,7 @@ export class P2Component implements OnInit {
datas
:
Data
[]
=
[];
result
:
any
;
// result = 0
;
total
:
any
;
message
=
''
;
...
...
@@ -49,12 +49,13 @@ export class P2Component implements OnInit {
}
totalPrice
():
void
{
const
result
=
0
;
for
(
const
i
=
0
;
i
<
this
.
datas
.
length
;
i
++
)
{
const
data
=
this
.
datas
;
this
.
result
=
this
.
result
+
data
[
i
]
.
total
;
)
{
const
data
=
this
.
datas
[
i
]
;
result
=
result
+
data
.
total
;
}
return
this
.
result
;
return
result
;
}
deleteItem
(
name
,
i
):
void
{
...
...
src/app/p3/p3.component.html
View file @
555c96b6
<p
style=
"color:green"
>
題三
</p>
<p>
<h4>
作業連結
</h4>
(目前在stackblitz能做出來,但用自己的電腦卻bulid不起來,無法display):
<br>
<a
href=
"https://stackblitz.com/edit/angular-cjmsgg"
>
Stackblitz
</a>
<!-- <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>
</p>
-->
<router-outlet></router-outlet>
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