Angular2 component for editing large json documents
npm install ng2-json-editor


Angular2 component for editing large json documents.
``bash
npm install --save ng2-json-editor
yarn add ng2-json-editor
`
#### Style Requirements
- Bootstrap
- Font Awesone
- KaTeX (Needed when using latexPreviewEnabled config)
Styles above must be available globally in your application, if you are using Angular CLI you can have a look at example-app's angular-cli.json to
see how to include those styles in your application.
`typescript`
import { JsonEditorModule } from 'ng2-json-editor';
Then add it to your module's imports.
`html`
- config: JsonEditoConfig : configuration object. See configuration docs for options.schema: JSONSchema
- : valid json-schema for the record. See json schema limitationsrecord: object
- : valid json to be edited.recordChange: EventEmitter
-
Please have a look at example app
ng2-json-editor has very limited support for anyOf, support where all anyOf items have same propertiesanyOf
and they are objects with primitive properties. Before display, it picks the first item, merges all enum values andpattern
removes and format rules.
Make sure you have Node version >= 6.9 and NPM >= 3
`bashclone our repo or alternatively your fork
git clone https://github.com/inveniosoftware-contrib/ng2-json-editor.git
$3
`bash
in ng2-json-editor
do initial build into dist
yarn buildcopy package.json to dist
yarn copygo to dist folder and link it
cd dist
npm linkremove node_modules inside dist which might cause weird errors
rm -rf node_modules/in another terminal session
watch changes on src, so that all will be available on the linked module
yarn gulp watch
``bash
in another module
npm link ng2-json-editor
`$3
-
yarn start
- Put breakpoints
- Go to debug view (shift+mod+d)
- Run debugger with e2e configuration (f5)$3
`bash
build the editor and start the server with example app
yarn startrun unit tests
yarn test:unitrun e2e tests (an instance should be running)
yarn test:e2etest and watch (for usually debugging tests)
yarn test:watchbuild
yarn build
``Please see CONTRIBUTING