Skip to content
Michał edited this page Feb 26, 2016 · 7 revisions

mwFormBuilder directive

Available attributes:

  • formData - object with form definition (required)
  • readOnly - boolean (optional)
  • options - additional options object (optional)
  • onImageSelection - callback on image selection button click, has to return promise with image src (optional)
  • api - API object (optional)

options

questionTypes

Array of strings. Used to specify available question types.

All possible values:

['text', 'textarea', 'radio', 'checkbox', 'grid', 'priority', 'division', 'number', 'date', 'time', 'datetime', 'email', 'range', 'url']

onImageSelection

Simple example:

options.onImageSelection = function (){
        var d = $q.defer();
        var src = prompt("Please enter image src");
        if(src !=null){
            d.resolve(src);
        }else{
            d.reject();
        }

        return d.promise;
    };

api

Available methods:

  • reset()

mwFormViewer directive

Attributes:

  • formData - object with form definition (required)
  • responseData - object with response data (required)
  • onSubmit - form submit callback, has to return promise (required)
  • readOnly - boolean (optional)
  • options - additional options object (optional)
  • formStatus - object, wrapper for parent angular form object (optional)
  • api - API object (optional)

api

Available methods:

  • reset()
Clone this wiki locally