|
@@ -62,10 +62,12 @@
|
62
|
62
|
for (element of articles) {
|
63
|
63
|
axios.get(`http://localhost:5000/articles/${element}`)
|
64
|
64
|
.then(response => {
|
65
|
|
- let articlesHeading = document.querySelector("#articles-heading");
|
66
|
|
- let articleElm = document.createElement("pre");
|
67
|
|
- articleElm.textContent = response.data;
|
68
|
|
- articlesHeading.appendChild(articleElm);
|
|
65
|
+ let articlesHeading = document.querySelector("#articles-heading").parentElement;
|
|
66
|
+ let articleDiv = document.createElement("button");
|
|
67
|
+ articleDiv.textContent = response.data;
|
|
68
|
+
|
|
69
|
+ articleDiv.classList.add("m-5", "article-content");
|
|
70
|
+ articlesHeading.appendChild(articleDiv);
|
69
|
71
|
})
|
70
|
72
|
.catch(error => console.error(error));
|
71
|
73
|
}
|
|
@@ -121,7 +123,6 @@
|
121
|
123
|
<div class="core">
|
122
|
124
|
<i class="icon-columns to-animate-2"></i>
|
123
|
125
|
<div class="fh5co-post to-animate">
|
124
|
|
- <!-- <h3 async onload="fetchArticle();">Articles</h3> -->
|
125
|
126
|
<h3 id="articles-heading">Articles</h3>
|
126
|
127
|
</div>
|
127
|
128
|
</div>
|