Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
521 B
1
Indexable
Never
import { Application } from "./application.js";
import { Flashcard } from "./flashcard.js";

const app = new Application();
app.drawForm(document.body);

const result = await fetch("http://localhost:5229/Flashcard/GetAllFlashcards");
const data = await result.json();

const cardsDiv = document.createElement("div")
cardsDiv.classList.add("cards-div");
document.body.appendChild(cardsDiv);

for(let f of data){
    const card = new Flashcard(f.id, f.color, f.front, f.back);
    card.drawCard(cardsDiv);
}
Leave a Comment