Angular 2 component for objects debug. Collapsible JSON in HTML with syntax highlight like Chrome DevTools http://temich.in.ua/t-json-viewer/
npm install t-json-viewer --save
NPM Package: https://www.npmjs.com/package/t-json-viewer
Import TJsonViewerModule to have access to following component
import {TJsonViewerModule} from 't-json-viewer';
@NgModule({
...,
imports: [
...,
TJsonViewerModule,
...
],
...
})
export class AppModule { }
Takes an input [json]
that can be data bound to any object.
@Component({
...,
template: `
<t-json-viewer [json]="asset"></t-json-viewer>
`
})
export class MyComponent {
...
ngOnInit() {
this.asset = {};
...
}
...
}