From e90439c3f8818b25db295792f72397bc25d237ef Mon Sep 17 00:00:00 2001
From: Lucas <lucas.villaume8@etu.univ-lorraine.fr>
Date: Sun, 26 Nov 2023 16:48:29 +0100
Subject: [PATCH] Fix modelisation JSON
---
modele/Expression.js | 2 +-
modele/Feuille.js | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/modele/Expression.js b/modele/Expression.js
index 860cd42..740826d 100644
--- a/modele/Expression.js
+++ b/modele/Expression.js
@@ -1,7 +1,7 @@
class Expression{
#contenu;
- construction(content = ""){
+ constructor(content = ""){
this.#contenu = content;
}
diff --git a/modele/Feuille.js b/modele/Feuille.js
index ecfb2c7..70de6da 100644
--- a/modele/Feuille.js
+++ b/modele/Feuille.js
@@ -24,9 +24,12 @@ class Feuille extends Component{
toJSON(){
let cellsJSON = [];
+ let tmp = [];
for (let i = 0; i < this.#cells.length; i++){
- this.#cells[i].forEach(cell => cellsJSON.push(cell.toJSON()));
+ this.#cells[i].forEach(cell => tmp.push(cell.toJSON()));
+ cellsJSON.push(tmp);
+ tmp = [];
}
return {
--
GitLab