How can i go back to page 1 and restart survey once complete button is pressed?
@asadmalik3
survey.clear();
survey.render();
Thank you,
Andrew
i am using survey-angular library, and i am generating form using below code
var survey = new Survey.ReactSurveyModel(surveyJSON);
survey.onComplete.add(sendDataToServer);
Survey.SurveyNG.render("surveyElement", {model:survey});
I dont find any method to clear the survey.
@asadmalik3 here is the example: https://plnkr.co/edit/MVXFVl0OmUG893qP25tp?p=preview
Thank you,
Andrew
@andrewtelnov thanks for your help. But i am facing a small issue, i am using survey-angular library which i have installed in my angular application through npm, here is the link to it https://www.npmjs.com/package/survey-angular
The way i am creating survey in my angular component is given below in image

But when on complete method is hit, i get this below error in console

@asadmalik3 You have the error in your console. That is why it doesn't work.
It is hard to say what is going on. Could you create an example on plunker? or provide us with JSON.
Do you use any events?
Thank you,
Andrew
@andrewtelnov Thanks alot for your help. I tried to product this error in plunkr but wasn't able to do so, it is working fine in plunkr, so it might be some issue in my local code.
I have another small question, once survey is completed i want to re-start it with some data, how can i do this? Here is the plunkr
@asadmalik3 I have made the fork and modify an example: https://plnkr.co/edit/fmKB94zpvLH2FI8Cni2v
Unfortunately, it doesn't work due a small bug. I have just fixed it. The code will work from the next minor version that we will release on the next week.
Thank you,
Andrew
Thank you. I am waiting for that update.
@andrewtelnov any word about the update? is it released?
@asadmalik3 It works as expected now. You may just try the example I have posted above.
Thank you,
Andrew
Most helpful comment
@asadmalik3
Thank you,
Andrew