Skip to content

A collection of Ember.js form components for aptible/ember-json-schema-document

License

Notifications You must be signed in to change notification settings

aptible/ember-json-schema-views

Folders and files

NameName
Last commit message
Last commit date

Latest commit

439f4f0 · Aug 7, 2024

History

95 Commits
May 10, 2019
Feb 7, 2018
Feb 7, 2018
Feb 6, 2018
Feb 6, 2018
Feb 3, 2016
Feb 3, 2016
Feb 3, 2016
Feb 3, 2016
Feb 6, 2018
Feb 6, 2018
Feb 3, 2016
Feb 6, 2018
Feb 3, 2016
Feb 3, 2016
Feb 3, 2016
Feb 28, 2023
Feb 6, 2018
Feb 3, 2016
Feb 6, 2018
Feb 7, 2018
Feb 6, 2018
Feb 7, 2018

Repository files navigation

ember-json-schema-views

This addon extends aptible/ember-json-schema-document with basic JSON Schema-driven form components.

The following JSON Schema property types are supported:

  • boolean using schema-field-radio or schema-field-toggle
  • enum using schema-field-select
  • text using schema-field-text

Schema properties can be recursed using the each-property component.

Example: Generating a Schema-driven form by recursing Schema properties

The following template will iterate a schema's properties and build UI components that are bound to corresponding document values;

var schema = new Schema(jsonBlob);
var document = schema.buildDocument();
var properties = schema.properties();
{{#each-property properties=properties as |key property type|}}
  <label>{{property.displayProperties.title}}</label>
  {{component (concat 'schema-field-' type) key=key property=property document=location}}
{{/each-property}}

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.