surveyjs / surveyjs_angular_cli

SurveyJS + Angular CLI Quickstart Template
http://surveyjs.io/
41 stars 52 forks source link

Custom widget #32

Closed npupiec closed 4 years ago

npupiec commented 5 years ago

Hi How can I add custom widget (https://next.plnkr.co/edit/fXsLf1R88WxxDFaFEnYx?p=preview&preview) to SurveyJS Creator??

When I import file customwidget.js to my SurveyJS Creator component nothing happend. Thanks

tsv2013 commented 5 years ago

As you can see, custom widget is added automatically after registration: image

But for the angular version you need to register a custom widget in survey-angular

Survey.CustomWidgetCollection.Instance.addCustomWidget(widget, "customtype");

and in the survey-knockout (because survey-creator uses the survey-knockout library):

SurveyKo.CustomWidgetCollection.Instance.addCustomWidget(widget, "customtype");
npupiec commented 5 years ago

@tsv2013 thank you When I do this I get error in console ERROR TypeError: Cannot read property 'getType' of null

tsv2013 commented 5 years ago

@npupiec Can you share a sample to reproduce the issue?