A simple object editor based on JSON schema by GerhardHH
Click here to see Demo and API on GitHub
e2u-json-object-editor
takes in a JSON schema of type object and builds a form,
exposing a value
property that represents an object described by the schema.
JSON schema is defined here: http://json-schema.org/
It is inspired by eco-json-schema-object
, see
http://ecoutu.github.io/eco-json-schema-form/components/eco-json-schema-form/.
However, while trying to modify this to achieve editablility for a given value, I found it might be possible to simplify the component by reducing it to the basic needs and change the data binding.
For more information, see the code and the demo which provides code comments.
First, make sure you have the Polymer CLI and bower (https://bower.io/) installed.
After git clone, perform the following steps:
- run
bower install
to download dependent modules - then run
polymer serve
to serve your application locally.
See the displayed URL and open it in your browser. Alternatively, you may
call polymer serve --open
bower install GerhardHH/e2u-json-object-editor
Then you can use the element in your project as usual.
You may incorporate the element into your page like:
<e2u-json-object-editor
schema="[[schema]]" value="{{value}}"
label="Energy2use JSON schema object editor">
</e2u-json-object-editor>
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
2017-02-15: Initial version
Thanks to Eric Coutu eric.coutu@gmail.com for his eco-json-schema-form project, which inspired me for this: https://github.com/ecoutu/eco-json-schema-form
MIT license, see LICENSE