I am in the process of developing a dynamic questionnaire service that utilizes a dynamic form approach. The structure consists of a question base followed by various types of questions such as textboxes, dropdowns, etc.
My next step was to create a questionnaire object which includes an array of questions along with additional information like ID and the poster's details.
However, upon calling the add() function in question.service.ts, I encountered an error stating that 'questionnaireobj' is not defined. This made me wonder if I properly instantiated a 'questionnaireobj' instance in questionnaireObj.ts or if I referenced it incorrectly in question.service.ts.
Here are snippets of the code:
question-base.ts
export class QuestionBase<T>{
// code here
}
question-textbox.ts
export class TextboxQuestion extends QuestionBase<string> {
// code here
}
question.service.ts
// code here
questionnaireObj.ts
import { DropdownQuestion } from './question-dropdown';
import { QuestionBase } from './question-base';
import { TextboxQuestion } from './question-textbox';
import { Injectable } from '@angular/core';
@Injectable()
export class QuestionnaireObj {
// code here
}