# angular-schema-form **Repository Path**: pingm/angular-schema-form ## Basic Information - **Project Name**: angular-schema-form - **Description**: Generate forms from a JSON schema, with AngularJS! - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-11-26 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Angular Schema Form =================== [](#bower) [](https://www.npmjs.org/package/angular-schema-form) [](http://npm-stat.com/charts.html?package=angular-schema-form&from=2015-01-01) [](https://gitter.im/Textalk/angular-schema-form?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://travis-ci.org/Textalk/angular-schema-form) [](https://coveralls.io/r/Textalk/angular-schema-form?branch=development) Generate forms from JSON schemas using AngularJS! Recent developments =================== First, as there has been a rather intensive period of planning and change for this project, there have been important new developments for the project. Lets get into those first(the normal front page continues below): The json-schema-form standard ----------------------------- A standard, json-schema-form, is being created. The concept of combining data, JSON Schema and a form definition, is something that isn't just usable in a JavaScript Angular web application, but in any framework, on any platform. Current ports are [angular-schema-form](https://github.com/json-schema-form/angular-schema-form) and [react-schema-form](https://github.com/networknt/react-schema-form), but delphi-schema-form and laravel-schema-form are planned as well. To make these ports easier to do, and for everything to work in harmony, a common ground has to be established, a [standard](https://github.com/json-schema-form/json-schema-form). Organisational -------------- 1. ASF has changed into using a more open governance model. This basically means that ASF is now governed by more people. 2. An umbrella organisaton, json-schema-form, has been formed. As you can see, this repo is now a part of that Github organisation, not Textalk. Projects -------- After a phase of planning, the following list of projects has been decided upon: https://github.com/json-schema-form/json-schema-form/wiki/Current-projects Release 1.0 ----------- The next major release of ASF will be 1.0. The goal for that version is to include the breaking changes that is needed for future developments, like *Of and local $refs: * Break out the non-framework specific parts of ASF into a vanilla ES6 module * Remove the built-in bootstrap decorator, and in doing that require that users wanting to use that load that separately. The reason obviously being the material decorator. The reason for the core break out is for all javascript-based ports of the json-schema-form concept to be able to share the same central code base. Work in that direction is being done in the [json-schema-form-core](https://github.com/json-schema-form/json-schema-form-core) repository. Schema builder UI ----------------- There is now a UI for building schemas and forms being developed at [json-schema-builder repository](https://github.com/json-schema-form/json-schema-builder). Ralphael Owino (main author), has a [demo up already](http://ralphowino.github.io/schema-form-builder/#/builder). Schema and form repository -------------------------- This is now a [repository with template schemas and forms](https://github.com/json-schema-form/json-schema-form-repository). So far all the [schema.org types](http://schema.org/docs/full.html) has been converted to JSON schema approximations, and also some has been further resolved and had (huge) forms generated. Schema.org is *big*. Documentation ------------- The documentation is evolving, and it is happening mostly on the wiki: * [The ASF wiki](https://github.com/json-schema-form/angular-schema-form/wiki) * [The wiki of the json-schema-form organisation](https://github.com/json-schema-form/json-schema-form/wiki) New Gitter rooms ---------------- These are just started. * Discussions on the [general json-schema-form projects being carried out](https://gitter.im/json-schema-form/json-schema-form-projects) * Discussions on the [angular-specific ASF projects](https://gitter.im/json-schema-form/angular-schema-form-projects) The Blog / The Web Site / The Twitter / The Movie ================================================= [medium.com/@SchemaFormIO](https://medium.com/@SchemaFormIO) / [schemaform.io](http://schemaform.io) / [@SchemaFormIO](http://twitter.com/SchemaFormIO) / [Movie](https://www.youtube.com/watch?v=duBFMipRq2o) If you use ASF in your project/company please let us know! We'd love to feature you on the site. Demo Time! ========== [Try out the example page](http://schemaform.io/examples/bootstrap-example.html). Try editing the schema or form definition and see what comes out! Hint: By pressing the 'Save to gist' button (top left), you can save your example into a shareable link. What is it? =========== Schema Form is a set of AngularJS directives (and a couple of services). It can do two things to make life easier: 1. Create a form directly from a JSON schema. 2. Validate form fields against that same JSON schema. Schema Form uses convention over configuration, so it comes packaged with some sensible defaults. But you can always customize it by changing the order and types of form fields. #### JSON Form Schema Form is inspired by the nice [JSON Form](https://github.com/joshfire/jsonform) library and aims to be roughly compatible with it, especially its form definition. So what sets Schema Form apart from JSON Form? 1. Schema Form integrates deeply with AngularJS and uses AngularJS conventions to handle forms. 2. Schema Form uses [tv4](https://github.com/geraintluff/tv4) for validation, making it compatible with version 4 of the JSON schema standard. 3. By default, Schema Form generates Bootstrap 3-friendly HTML. Documentation ------------- You can find [all documentation here](docs/index.md), it covers all the different field types and their options. It also covers how to [extend angular schema form with your own field types](https://github.com/Textalk/angular-schema-form/blob/master/docs/extending.md). Basic Usage ----------- First, expose your schema, form, and model to the $scope. ```javascript angular.module('myModule', ['schemaForm']) .controller('FormController', function($scope) { $scope.schema = { type: "object", properties: { name: { type: "string", minLength: 2, title: "Name", description: "Name or alias" }, title: { type: "string", enum: ['dr','jr','sir','mrs','mr','NaN','dj'] } } }; $scope.form = [ "*", { type: "submit", title: "Save" } ]; $scope.model = {}; }); ``` Then load them into Schema Form using the `sfSchema`, `sfForm`, and `sfModel` directives. ```html