Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/devmark/ngx-jsoneditor

a wrapper for json editor(http://jsoneditoronline.org)
https://github.com/devmark/ngx-jsoneditor

angular editor json json-editor

Last synced: 23 days ago
JSON representation

a wrapper for json editor(http://jsoneditoronline.org)

Awesome Lists containing this project

README

        

# ngx-jsoneditor

## Installation

- Include JSONEditor css/js in your application :
```

```

To install this library, run:

```bash
$ npm install ngx-jsoneditor --save
```

## Consuming your library

Once you have published your library to npm, you can import your library in any Angular application by running:

```bash
$ npm install ngx-jsoneditor
```

and then from your Angular `AppModule`:

```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import your library
import { JSONEditorModule } from 'ngx-jsoneditor';

@NgModule({
declarations: [
AppComponent
],
imports: [
// Specify your library as an import
JSONEditorModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```

Once your library is imported, you can use its components, directives and pipes in your Angular application:

```javascript
import { Component } from '@angular/core';

@Component({
selector: 'sample',
template: `

collapseAll
expandAll
`
})
export class Sample{
constructor(){
this.jsonContent = {
"Array": [1, 2, 3],
"Boolean": true,
"Null": null,
"Number": 123,
"Object": {"a": "b", "c": "d"},
"String": "Hello World"
};
}
onChange(value){

}
}
```

## Configuration
* `config` : The configuration object for JSONEditor see https://github.com/josdejong/jsoneditor/blob/master/docs/api.md#configuration-options

## Development

To generate all `*.js`, `*.d.ts` and `*.metadata.json` files:

```bash
$ npm run build
```

To lint all `*.ts` files:

```bash
$ npm run lint
```

## License

MIT © [DevMark](mailto:[email protected])