I have an older project in Ionic v1 (Angular 1.x) where users can create groups and add members. I need to add a capability to the App for the group Admin to ask questions to group members - sort of a dynamic form. The questions can be of three types - a Yes/No (to be shown as a toggle), String (input Text) and a question with choices (to be shown as a select drop down). The number of questions can vary.
The questions are stored along the lines of the hash below.
{
id1: {q: "question1", type: "String"},
id2: {q: "question2", type: "Yes/No"}
id3: {q: "question3", type: "Choice", choices: "Choice1, Choice2, Choice3"},
id4: {q: "question4", type: "String"},
id5: {q: "question5", type: "Yes/No"}
id6: {q: "question6", type: "Choice", choices: "Choice4, Choice5, Choice6"}
}
I am trying to think of the best way to be able to show these questions dynamically to the user and collect the answers but not quite sure what's the best way to do this. I started looking at trying to create a Directive but wanted to get advice before spending too much time down a path.
Look forward to your thoughts and suggestions.
-S