0.0.8 • Published 9 years ago
json2dom-js v0.0.8
json2dom-js
It will make HTML DOM from json format file.
Install
npm install json2dom-js
Sample Code
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);
});
Sample JSON
{
"$wrapper": {
"type": "div",
"style": "width: 100%; position:relative; margin:0 auto, background-color:#000;",
"$content": {
"type": "div"
}
}
}
Author
Repository
Lisence
Apache-2.0