Socket
Socket
Sign inDemoInstall

ember-jsoneditor

Package Overview
Dependencies
5
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ember-jsoneditor

Ember component to view, edit and format JSON.


Version published
Weekly downloads
238
decreased by-46.99%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

v1.0.0 - 2020-03-29

Merged

Commits

Readme

Source

ember-jsoneditor npm version

Ember component for JSON Editor to view, edit and format JSON.

Live demo: http://glavin001.github.io/ember-jsoneditor/

Compatibility

  • Ember.js v3.4 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Previous versions compatibility

  • ember-json-editor v9.3 - Ember.js 2.4 and above

Installation

ember install ember-jsoneditor

Usage

<JsonEditor @json={{this.model}} @mode={{this.mode}} @name={{this.name}} />

For Ember versions < 3.4, you need to use classic component invocation:

{{json-editor json=model mode=mode name=name}}

For a complete example, see the dummy test app in tests/dummy/app/.

Documentation

See jsoneditor for configuration details. ember-jsoneditor supports the following jsoneditor options:

OptionDescriptionDefault
changemaps to jsoneditor's onChange eventnull
errormaps to jsoneditor's onError eventnull
expandif true, renders with json tree expandedfalse
historyEnables history undo/redo buttontrue
indentationnumber of indentation spaces2
modeEditor mode - modestree
modesDrop down to select editor mode. Options: 'tree', 'view', 'form', 'code', 'text'All options
nameField name for the JSON root node,null
searchboolean - show editor search boxtrue

Example using event options

{{!-- app/templates/application.hbs --}}

<JsonEditor 
  @json={{this.model}} 
  @mode={{this.mode}} 
  @name={{this.name}} 
  @change={{action 'itChanged'}} 
  @error={{action 'myError'}} 
/>
// app/controllers/application.js
import Controller from '@ember/controller';

export default Controller.extend({
   /// ....
   actions: {
    myError(error){
      alert(`Error: ${error}`)
    },

    itChanged() {
      alert("The Data Changed!");
    }
  }
})

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Keywords

FAQs

Last updated on 29 Mar 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc