Skip to content

Commit 9d0a95e

Browse files
updated
1 parent 68f340e commit 9d0a95e

4 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/app/Products.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"products": [
33
{
4-
"userId": 1,
4+
"userId": null,
55
"id": 0,
6-
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
7-
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
6+
"title": null,
7+
"body": null
88
},
99
{
1010
"userId": 1,
@@ -112,7 +112,7 @@
112112
"userId": 1,
113113
"id": 20,
114114
"title": "Run",
115-
"body": "Sample"
115+
"body": "Sample1"
116116
}
117117
]
118118
}

src/app/sub/sub.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ <h1>local json-server http://localhost:5555/products</h1>
88
<th>Title</th>
99
<th>Body</th>
1010
<th>Edit</th>
11+
<th>Update</th>
1112
<th>Delete</th>
1213
</tr>
1314
</thead>
@@ -20,6 +21,7 @@ <h1>local json-server http://localhost:5555/products</h1>
2021
<td>{{product.body}}</td>
2122
<td><button (click)="edit1(product,i)" class="btn"><abbr title="edit"><i
2223
class="fas fa-edit"></i></abbr></button></td>
24+
<td><button (click)="edit2()" class="btn"><i class="fas fa-pen"></i></button></td>
2325
<td><button (click)="delete(i)" class="btn"><abbr title="delete"><i
2426
class="fas fa-trash-alt"></i></abbr></button></td>
2527
</tr>
@@ -77,7 +79,7 @@ <h1>Local Server Form</h1>
7779

7880
<div class="d-grid gap-2">
7981
<button (click)="add()" [disabled]="form.invalid" type="button" class="btn btn-outline-success">Post</button>
80-
<button (click)="edit2()" type="button" class="btn btn-outline-success">Edit</button>
82+
8183
</div>
8284
</form>
8385
</div>

src/app/sub/sub.component.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ export class SubComponent implements OnInit {
3131
body: new FormControl('', [Validators.required])
3232
});
3333

34-
refresh = (): any => {
35-
this.form.setValue({
36-
userId: null,
37-
id: null,
38-
title: null,
39-
body: null
40-
});
41-
}
4234

4335
add = (): any => {
4436
let temp = new Sample();

src/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.min.js" integrity="sha384-j0CNLUeiqtyaRmlzUHCPZ+Gy5fQu0dQ6eZ/xAww941Ai1SxSY+0EQqNXNE6DZiVc" crossorigin="anonymous"></script>
1515
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
1616
<script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
17+
<script src="https://unpkg.com/ionicons@5.4.0/dist/ionicons.js"></script>
18+
1719

1820
</head>
1921
<body class="mat-typography">

0 commit comments

Comments
 (0)