It will make HTML DOM from json format file.
npm install json2dom-js
class Controller {
beforeContentCreate(data){
// some action for before create 'Content' element
return true;
}
}
const ctl = new Controller();
const Json2Dom = require('json2dom-js');
const j2d = new Json2Dom(ctl);
j2d.load('path/to/format.js').then((dom) => {
const target = document.getElementById('target');
target.appendChild(dom);
});
{
"$wrapper": {
"type": "div",
"style": "width: 100%; position:relative; margin:0 auto, background-color:#000;",
"$content": {
"type": "div"
}
}
}
Apache-2.0