/json-selector

An angular directive to format and select elements from JSON

Primary LanguageJavaScriptOtherNOASSERTION

JSON Selector: An angular directive to format and select elements from JSON

Build Status Code Climate

This repository is inspired by https://github.com/mohsen1/json-formatter. It is customized for some specific usage. Hence it adds the ability to select elements from the JSON, but lacks configuration via JSONFormatterConfig. Also, npm packages are no longer supported.

Screenshot

Usage

  • Install via Bower

    bower install json-selector --save
  • Add jsonSelector to your app dependencies

    angular.module('MyApp', ['jsonSelector'])
  • Use <json-selector> directive

    <json-selector json="{my: 'json'}" open="1" selectable="true" allow-root-select="false" model="mymodel"></json-formatter>
    • open attribute accepts a number that indicated how many levels JSON should be open

    • json attribute sets the JSON which needs to be rendered.

    • selectable sets whether the nodes are selectable via checkboxes.

    • allow-root-select allows/denies selecting of root element.

    • model is an array of expressions which are selected.