angular-surveys
angular-surveys copied to clipboard
Adding new elements
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.
I'm really interested by your answer. I also want to know if it's possible to add custom widgets.
Thank you in advance
Me too. Was looking how to replace the templates used by the directives, but haven't succeeded yet.
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