Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
});