Skip to content

Defining the "Basic Usage" #3

@ThomasPe

Description

@ThomasPe

So we can work towards a common goal I'd like to discuss how exactly the Json Schema Builder should be used / called / included.
I created a small "Basic Usage" example based on the Angular Schema Form Example.
As I see it, it should be enough to just have a $scope.schema and a $scope.form (and an optional $scope.options) object for passing & receiving data, right?

Here's what I think it could look like (from my fork)

First, expose your (existing) schema and form to the $scope.

angular.module('myModule', ['schemaFormBuilder'])
       .controller('FormBuilderController', function($scope) {
  // JSON Schema
  // add an existing schema to edit it
  // or leave blank to create a new form
  $scope.schema = {};

  // Schema Form Defintion
  // add an existing form definition for editing
  // or leave blank to create a new form
  $scope.form = [];


});

Then load them into the Schema Form Builder using the sfbSchema and sfbForm directives.

<div ng-controller="FormBuilderController">
    <div sfb-schema="schema" sfb-form="form"></form>
</div>

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions