angular-json-editor

WebJar for angular-json-editor

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks JSON Data
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-json-editor
Last Version

Last Version

0.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

angular-json-editor
WebJar for angular-json-editor
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/rodikh/angular-json-editor

Download angular-json-editor

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-json-editor/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-json-editor</artifactId>
    <version>0.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-json-editor/
implementation 'org.webjars.bower:angular-json-editor:0.3.1'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-json-editor/
implementation ("org.webjars.bower:angular-json-editor:0.3.1")
'org.webjars.bower:angular-json-editor:jar:0.3.1'
<dependency org="org.webjars.bower" name="angular-json-editor" rev="0.3.1">
  <artifact name="angular-json-editor" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-json-editor', version='0.3.1')
)
libraryDependencies += "org.webjars.bower" % "angular-json-editor" % "0.3.1"
[org.webjars.bower/angular-json-editor "0.3.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.bower : json-editor jar [0.7.28,0.8)
org.webjars.bower : angular jar [1,2)

Project Modules

There are no modules declared in this project.

JSON Editor Angular directive

A directive that wraps jdorn's json-editor.

JSON Editor takes a JSON Schema and uses it to generate an HTML form.

For further information about supported schema properties and usage, check out the original json-editor.

Requirements

The module doesn't include the original json-editor code, but it is included in it's bower dependencies.

Installation

Install via bower

bower install angular-json-editor --save

Then include the directive and json-editor in your html (you can also use the minified versions)

<script src="bower_components/json-editor/dist/jsoneditor.js"></script>
<script src="bower_components/angular-json-editor/dist/angular-json-editor.js"></script>

Usage

The directive supports both synchronous and asynchronous values, all values can be either a scope object, or a promise returned from $q, $http, $timeout, $resource etc. Please check out demo/index.html and demo/app.js for an example usage of both scenarios.

Validation

The directive exposes an isValid property on the scope, which can be used to enable/disable show/hide buttons using ng-disabled/ng-enabled or ng-hide/ng-show.

<button type="button" ng-disabled="!isValid">Button 1</button>

Events

The directive allows you to pass a callback function through the on-change attribute that will be called whenever a change event is fired on the editor.

    <json-editor schema="mySchema" startval="myStartVal" buttons-controller="SyncButtonsController" on-change="onChange()">

Configuration and Plugins

Configuring the JSONEditor object for plugins and styling is possible by injecting the JSONEditorProvider to your config function and calling the configure method. The object you pass to configure will be merged with the JSONEditor object.

    angular.module('demoApp', ['angular-json-editor']).config(function (JSONEditorProvider) {
        JSONEditorProvider.configure({
            plugins: {
                sceditor: {
                    style: 'sce/development/jquery.sceditor.default.css'
                }
            },
            defaults: {
                options: {
                    iconlib: 'bootstrap3',
                    theme: 'bootstrap3',
                    ajax: true
                }
            }
        }); 
    });

Building

Clone the project, install bower and npm dependencies by running

bower install && npm install

If you dont have grunt-cli installed globally run npm install -g grunt-cli

Then run grunt and look in the dist folder.

The MIT License (MIT)

Copyright (c) 2015 Rodik Hanukaev

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Versions

Version
0.3.1
0.2.1
0.1.8