Ionic x SurveyJS


#1

Hi there,

I’ve created a survey on SurveyJS’s Visual Editor, and noticed that it provided the option to be embedded on a website. It had a snippet specifically for AngularJS (shown below) and I wondered if it would be possible to integrate my survey into an Ionic app.

I’ve already tried integrating it a couple of times but it kept leading to an error believed to be internal to the surveyJS library.

SURVEYJS ANGULAR SNIPPET:

Survey.Survey.cssType = “bootstrap”;

var surveyJSON = { surveyId: ‘00000000-0000-0000-0000-000000000000’}

function sendDataToServer(survey) {
survey.sendResult(‘00000000-0000-0000-0000-000000000000’);
}

@Component({
selector: ‘ng-app’,
template:

",
})
export class AppComponent {
ngOnInit() {
var survey = new Survey.Model(surveyJSON);
survey.onComplete.add(sendDataToServer);
Survey.SurveyNG.render(“surveyElement”, { model: survey });
}
}

I would appreciate any advice or support.


#2

Hi @juleslui

I have developed an example project where I show how to integrate SurveyJS in Ionic APP. I hope it helps you.

Greetings


#3

So it really did just come down to a lack of understanding.

Thank you very much, sir @adrian_brito . Hope more good things come your way.