I want to to create a Form Builder in AngualrJS with Ability to add and remove unlimited Child-Questions to choices of Parent Questions like this:
Question 1
---Choice1.1
---Choice1.2
---Child-Question 1.1
---Choice1
---Choice2
---Child-Question 1.1.2
---Choice1
---Choice2
---Choice3
---Choice1.3
Question 2
---Choice2.1
---Choice2.2
---Choice2.3
This is sample JSON that I want to dynamically create:
{
title: "string",
description: "string",
questionType: 0,
option: {
min: 0,
max: 0,
step: 0,
unit: "string"
},
choices: [
{
title: "string",
order: 0,
matrixPosition: 0,
childQuestionTemplate: {}
},
{
title: "string",
order: 0,
matrixPosition: 0,
childQuestionTemplate: {
title: "string",
description: "string",
questionType: 0,
option: {},
choices: [
{
title: "string",
order: 0,
matrixPosition: 0,
childQuestionTemplate: {}
}
]
}
},
{
title: "string",
order: 0,
matrixPosition: 0,
childQuestionTemplate: {
id: 0,
title: "string",
description: "string",
questionType: 0,
option: {
min: 0,
max: 0,
step: 0,
unit: "string"
},
choices: [
{
title: "string",
order: 0,
matrixPosition: 0,
childQuestionTemplate: {
title: "string",
description: "string",
questionType: 0,
option: {},
choices: [
{
title: "string",
order: 0,
matrixPosition: 0,
childQuestionTemplate: {}
}
]
}
}
]
}
},
{
title: "string",
order: 0,
matrixPosition: 0,
childQuestionTemplate: {}
}
]
}
Now I want to know how I can select (get path of) a Choice from my HTML to Push a child question into that choice of other child question?