How to use the survey-angular.Model function in survey-angular

To help you get started, we’ve selected a few survey-angular examples, based on popular ways it is used in public projects.

github surveyjs / surveyjs_angular_cli / src / app / survey.component.ts View on Github external
ngOnInit() {
    const surveyModel = new Survey.Model(this.json);
    surveyModel.onAfterRenderQuestion.add((survey, options) => {
      if (!options.question.popupdescription) { return; }
      // Add a button;
      const btn = document.createElement('button');
      btn.className = 'btn btn-info btn-xs';
      btn.innerHTML = 'More Info';
      btn.onclick = function () {
        // showDescription(question);
        alert(options.question.popupdescription);
      };
      const header = options.htmlElement.querySelector('h5');
      const span = document.createElement('span');
      span.innerHTML = '  ';
      header.appendChild(span);
      header.appendChild(btn);
    });

survey-angular

survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.

MIT
Latest version published 2 days ago

Package Health Score

87 / 100
Full package analysis