angular-json-pretty

WebJar for angular-json-pretty

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks JSON Data
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-json-pretty
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

angular-json-pretty
WebJar for angular-json-pretty
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/leftstick/angular-json-pretty

Download angular-json-pretty

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : angular jar [1.3.5,1.4)

Project Modules

There are no modules declared in this project.

angular-json-pretty

A directive make json object or string printed in human readable way

DEMO

Install

bower install --save angular-json-pretty

Import

<link rel="stylesheet" href="angular-json-pretty.css"/>
<script type="text/javascript" src="angular-json-pretty.js"></script>

angular-json-pretty also support AMD and CMD. So you may already know how to import it into your code in the way you like.

Usage

Print JSON Object

<pre json-pretty data="jsonObj"></pre>
demo.controller('DemoController', function($scope) {
    $scope.jsonObj = {
        labels: ['1', '2', '3', '4', '5', '6'],
        series: [{
            name: 'Fibonacci sequence',
            data: [1, 2, 3, 5, 8, 13]
        }, {
            name: 'Golden section',
            data: [1, 1.618, 2.618, 4.236, 6.854, 11.09]
        }]
    };
});

Print JSON String

<pre json-pretty data="jsonStr"></pre>
demo.controller('DemoController', function($scope) {
    $scope.jsonStr = '{"name":"Test","series":[{"name":"Fibonacci sequence","data":[1,2,3,5,8,13]}]}';
});

LICENSE

MIT License

Versions

Version
1.0.0