-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Han Thuy Vi
committed
Jun 20, 2022
1 parent
a641264
commit a06482f
Showing
378 changed files
with
3,240 additions
and
13,938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json-server/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var coursesApi = 'http://localhost:3000/courses' | ||
|
||
function start() { | ||
getCouresApi(renderCode) | ||
|
||
}; | ||
start() | ||
|
||
function getCouresApi(callback) { | ||
fetch(coursesApi) | ||
.then(function (respones) { | ||
return respones.json(); | ||
}) | ||
.then(callback) | ||
}; | ||
|
||
function renderCode(courses) { | ||
var coursesblock = document.querySelector('#test') | ||
var html = courses.map(function (course) { | ||
return ` | ||
<li>${course.name} | ||
` | ||
}); | ||
coursesblock.innerHTML = html.join('') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"courses": [ | ||
{ | ||
"id": 1, | ||
"name": "JSON server", | ||
"descripttion": "Tham gia nhóm Học lập trình tại F8 trên Facebook để cùng nhau trao đổi trong quá trình học tập ❤️" | ||
}, | ||
{ | ||
"name": "HTML, CSS từ Zero đến Hero", | ||
"description": "Trong khóa này chúng ta sẽ cùng nhau xây dựng giao diện 2 trang web là The Band & Shopee.", | ||
"id": 2 | ||
}, | ||
{ | ||
"name": "Comments trong HTML", | ||
"description": "Để có cái nhìn tổng quan về ngành IT - Lập trình web các bạn nên xem các videos tại khóa này trước nhé.", | ||
"id": 3 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.