Skip to content

Commit

Permalink
feat: adds abilty to use '*' in layout array (#8)
Browse files Browse the repository at this point in the history
* feat(layout):  layout from schema

Adds the ability to generate layout nodes from
the json schema definition.  Use of the * key
allows for all remaining schema dataPointers to
be represented in the form.
Type information is also pulled over from the
schema when not given by the user.

* test: adds additional test cases

* chore: update compodoc version

Updates the version of compodoc plugin
in order to resolve bug with mark down
parsing

* refactor: adds missing dependency

* docs: Adds some docs for layout

First cut at drafting some docs
for current schema and layout
functionality

* fix: corrects issue with * layouts

Removes pointers to type object
from the pointer map so as not to be
included when using * layout

* docs: adds test example
  • Loading branch information
jscharett authored Jul 12, 2019
1 parent 9219404 commit 5f5c9b2
Show file tree
Hide file tree
Showing 20 changed files with 736 additions and 107 deletions.
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,43 @@ bring parity with [Angular JSON Schema Form](https://github.com/angular2-json-sc

[Check out some examples here.](https://jscharett.github.io/ngx-json-schema-form/)

### To install from NPM
## Using Angular JSON Schema Form

### Basic use

Begin by installing the library in your project

```
npm install ngx-json-schema-form --save
```

Then import JsonSchemaFormModule in your main application module:

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

import { JsonSchemaFormModule } from 'ngx-json-schema-form';

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

@NgModule({
declarations: [ AppComponent ],
imports: [
BrowserModule,
JsonSchemaFormModule
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
```
npm install ngx-json-schema-form

To display a form in your Angular component, simply add the following to your component's template:

```html
<json-schema-form
[schema]="schema"
></json-schema-form>
```

Where `schema` is a valid JSON schema object. If you don't already have your own schemas, you can find a bunch of samples to test with in the `src/demo/assets/example-schemas` folder.
209 changes: 170 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"ajv": "^6.10.0",
"brace": "^0.11.0",
"core-js": "^2.5.4",
"json-schema-traverse": "^0.4.1",
"lodash": "^4.17.11",
"ng2-ace-editor": "0.3.9",
"rxjs": "~6.5.2",
Expand All @@ -58,7 +59,7 @@
"@angular/cli": "~7.2.3",
"@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "~7.2.0",
"@compodoc/compodoc": "^1.1.9",
"@compodoc/compodoc": "^1.1.10",
"@types/jasmine": "~3.3.12",
"@types/jasminewd2": "~2.0.6",
"@types/node": "~8.9.4",
Expand Down
4 changes: 4 additions & 0 deletions projects/demo/src/assets/examples/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{
"name": "Simple Array",
"file": "simple-array"
},
{
"name": "Kitchen Sink",
"file": "kitchen-sink"
}
]
}
Expand Down
Loading

0 comments on commit 5f5c9b2

Please sign in to comment.