angular-surveys icon indicating copy to clipboard operation
angular-surveys copied to clipboard

Adding new elements

Open ompcse opened this issue 7 years ago • 3 comments

how can I add new form elements? is there any demo video or any steps you have uploaded? Please answer me quickly.

Thanks in Advance.

ompcse avatar May 31 '17 17:05 ompcse

I'm really interested by your answer. I also want to know if it's possible to add custom widgets.

Thank you in advance

mgendre avatar Jul 12 '17 11:07 mgendre

Me too. Was looking how to replace the templates used by the directives, but haven't succeeded yet.

mindscratch avatar Jul 13 '17 23:07 mindscratch

You have to update some files:

angular-surveys.json (choose the language you want): under the question object, in the sub-object type, you would add the object name and its display name such as:

"question": {
    "types" :{
        "type": {
            "name": "Name here" 
         }
     }
}

Builder

form-builder-options.service.js : update the constant for MW_QUESTION_TYPES where you add the type you just put into the

templates/mw-form-question-builder.html : under the ng-switch statement starting at line 34 add the builder elements to gather the necessary data you will also need to add a preview of the element under the preview ng-switch statement on line 110

Viewer

templates/mw-form-question.html : the whole file is one switch statement so then add what the a person would see when submitting the form, binding to a specific property

NOTE: The line numbers I used were in the bootstrap template. Have not looked at the material templates

TomOrth avatar Aug 10 '17 01:08 TomOrth