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.
-
Install via Bower
bower install json-selector --save
-
Add
jsonSelector
to your app dependenciesangular.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 openjson
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.