angular2-prettyjson
Advanced tools
Comparing version
@@ -0,3 +1,4 @@ | ||
export { PrettyJsonModule } from "./src/prettyjson.module"; | ||
export { SafeJsonPipe } from "./src/json.pipe"; | ||
export { PrettyJsonPipe } from "./src/prettyjson.pipe"; | ||
export { SafeJsonPipe } from "./src/json.pipe"; | ||
export { PrettyJsonComponent } from "./src/prettyjson.component"; |
"use strict"; | ||
var prettyjson_module_1 = require("./src/prettyjson.module"); | ||
exports.PrettyJsonModule = prettyjson_module_1.PrettyJsonModule; | ||
var json_pipe_1 = require("./src/json.pipe"); | ||
exports.SafeJsonPipe = json_pipe_1.SafeJsonPipe; | ||
var prettyjson_pipe_1 = require("./src/prettyjson.pipe"); | ||
exports.PrettyJsonPipe = prettyjson_pipe_1.PrettyJsonPipe; | ||
var json_pipe_1 = require("./src/json.pipe"); | ||
exports.SafeJsonPipe = json_pipe_1.SafeJsonPipe; | ||
var prettyjson_component_1 = require("./src/prettyjson.component"); | ||
exports.PrettyJsonComponent = prettyjson_component_1.PrettyJsonComponent; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "angular2-prettyjson", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Angular2 json utils. Includes a pipe to replace Angular's built in json pipe which implements spacing, avoids circular references. Also includes a component that will pretty print json with syntax highlight", | ||
@@ -24,7 +24,8 @@ "main": "index.js", | ||
"dependencies": { | ||
"@angular/core": "^2.0.0" | ||
"@angular/core": "^2.0.0", | ||
"rxjs": "^5.0.0-rc.4" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"@angular/common": "^2.0.0", | ||
"@angular/common": "^2.0.0", | ||
"expect": "^1.20.1", | ||
@@ -31,0 +32,0 @@ "htmltree": "0.0.4", |
@@ -1,2 +0,2 @@ | ||
# Angular 2 Pretty Json v2.0.0 | ||
# Angular 2 Pretty Json v2.0.1 | ||
@@ -66,4 +66,3 @@ A module for Angular 2 debug output of objects. Contains a pipe similar to [JsonPipe](https://angular.io/docs/ts/latest/api/common/index/JsonPipe-class.html) but adds support for spacing and handling of circular structures. | ||
```js | ||
import {PrettyJsonModule} from 'angular2-prettyjson'; | ||
import {SafeJsonPipe} from 'angular2-prettyjson/prettyjson'; | ||
import {PrettyJsonModule, SafeJsonPipe} from 'angular2-prettyjson'; | ||
import {JsonPipe} from '@angular/common'; | ||
@@ -121,4 +120,7 @@ | ||
```js | ||
import {PrettyJsonComponent} from 'angular2-prettyjson'; | ||
@Component({ | ||
.... | ||
entryComponents: [PrettyJsonComponent], // Add to entry components | ||
template: ` | ||
@@ -140,4 +142,3 @@ <prettyjson [obj]="theForm.value"></prettyjson> | ||
1. Changed dependencies to anything _above_ Angular RC1 | ||
1. Fixed styling of PrettyJsonComponent | ||
1. Added how-to integrate with Angular-CLI | ||
1. Export module, both pipes and the component at the top level of the module | ||
1. Update README |
@@ -12,3 +12,2 @@ "use strict"; | ||
var core_1 = require("@angular/core"); | ||
var prettyjson_pipe_1 = require("./prettyjson.pipe"); | ||
var PrettyJsonComponent = (function () { | ||
@@ -24,3 +23,2 @@ function PrettyJsonComponent() { | ||
selector: "prettyjson", | ||
pipes: [prettyjson_pipe_1.PrettyJsonPipe], | ||
template: "\n <pre [innerHtml]=\"obj | prettyjson\">\n </pre>\n ", | ||
@@ -27,0 +25,0 @@ styles: [ |
@@ -21,2 +21,5 @@ "use strict"; | ||
PrettyJsonPipe.prototype._syntaxHighlight = function (json, serializer, spacing) { | ||
if (json === undefined) { | ||
return '<span class="undefined"></span>'; | ||
} | ||
// Credits to the accepted answer here http://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript | ||
@@ -23,0 +26,0 @@ if (typeof json !== "string") { |
@@ -16,3 +16,4 @@ { | ||
"src/prettyjson.pipe.ts", | ||
"src/safe.util.ts" | ||
"src/safe.util.ts", | ||
"src/prettyjson.module.ts" | ||
], | ||
@@ -19,0 +20,0 @@ "exclude": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
37454
8.38%25
19.05%724
7.26%141
0.71%2
100%+ Added