-
Notifications
You must be signed in to change notification settings - Fork 0
/
examples.ts
23 lines (22 loc) · 1.1 KB
/
examples.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { StudySetData } from "./src/app/data-models/studyset-model";
const url = require('url');
let localSet = new StudySetData("me", "Made in code", "this test shows how the code works");
console.log("Our new set:", localSet);
console.log("Set is valid:", localSet.isValid());
console.log("Adding Cards to Set...");
localSet.addCard("card1", "this is card1");
localSet.addCard("card2", "this is card2");
localSet.addCard("lemon", "this is a lemon", url.pathToFileURL('./src/assets/images/lemon-pic.jpeg'));
console.log("Our set now:", localSet);
console.log("Set is valid:", localSet.isValid());
console.log("Lemon image url:", localSet.flashcards[2].image);
console.log("Let's add a sequence");
localSet.addSequence("first sequence", localSet.flashcards);
console.log("Let's reorder the flashcards");
console.log("Original Order", localSet.flashcards);
localSet.reorderCard(localSet.flashcards[1],0);
console.log("New Order", localSet.flashcards);
console.log("Let's delete a flashcard");
localSet.deleteCard(localSet.flashcards[0]);
console.log("Our set now:", localSet);
console.log("Our sequence:", localSet.sequences[0]);