We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c59198f commit 2ab4170Copy full SHA for 2ab4170
chapters/endpoints.qmd
@@ -16,17 +16,15 @@ lightbox: true
16
cats = FileAttachment("../_data/cats.json").json()
17
console.log(cats)
18
19
-// Create a container div for our carousel
20
viewof carousel = {
21
const wrapper = html`<div class="carousel-wrapper"></div>`;
22
23
- cats.then(data => {
24
- data.forEach(cat => {
25
- const img = document.createElement('img');
26
- img.src = cat.url;
27
- img.alt = 'Cat image';
28
- wrapper.appendChild(img);
29
- });
+ // No need for .then() as cats is already resolved
+ cats.forEach(cat => {
+ const img = document.createElement('img');
+ img.src = cat.url;
+ img.alt = 'Cat image';
+ wrapper.appendChild(img);
30
});
31
32
return wrapper;
0 commit comments