I am using a framework of slate.js named slate-plugins to build an editor. It worked to save the data in the database but the data saved as [Obj],[Obj] in the database instead of HTML data. Hence on calling the data at the frontend it is showing as [Obj][Obj] and not the actual content that I wrote.What should I do now
Asked
Active
Viewed 334 times
1 Answers
0
Your database (probably) can only store strings. So you have to serialize it before the save using JSON.stringify(value)
.
When you need to do the opposite operation, use JSON.parse(value_from_database)
to get an object Slate can understand.

crisdias
- 1