Skip to content

khchan/ngseed-form-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngform-builder

Angular Seed version of selmanh's fantastic form-builder (more info about his directive can be found on his page)

plnkr demo here

Dependencies

(Make sure you've included these scripts before including ngform-builder)

Bindings

  • form-builder: [form] - a json form object to edit using the form builder
  • form-directive: [showForm] - a json form object to render
  • field-directive: [field] - a json field object to render

Getting Started

In your js:

angular.module('main', ['ngform-builder'])
.controller('MainCtrl', function($scope) {
  $scope.testForm = {
    "form_type": "system",
    "form_name": "my_form",
    "form_title": "My Form",
    "form_submitText": "Submit Me",
    "form_cancelText": "Cancel Me",
    "form_questions": [
      {
        "field_id": 1,
        "field_name": "question_1_textfield",
        "field_title": "New textfield field 1",
        "field_type": "textfield",
        "field_value": "",
        "field_placeholder": "Enter a textfield value",
        "field_validation": {
          "rule": "none",
          "expression": ""
        },
        "field_helpertext": "missing input or invalid",
        "field_hasOptions": false,
        "field_required": true
      }
    ]
  };
});

In your html:

<body ng-controller="MainCtrl">
  <form-builder form="testForm"></form-builder>
</body>

Testing

To run unit tests: npm test

To run e2e tests: run grunt to start server then run npm run protractor

Distribution

To generate a production js and minified js, simply run grunt build and these files will be created for you in the dist folder

License

MIT

About

Angular Seed version of selmanh's fantastic form-builder: https://github.com/selmanh/angularjs-form-builder/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published