Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new elements #42

Open
ompcse opened this issue May 31, 2017 · 3 comments
Open

Adding new elements #42

ompcse opened this issue May 31, 2017 · 3 comments

Comments

@ompcse
Copy link

ompcse commented May 31, 2017

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.

@mgendre
Copy link

mgendre commented Jul 12, 2017

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

Thank you in advance

@mindscratch
Copy link

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

@TomOrth
Copy link

TomOrth commented Aug 10, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants