の配列にネストされた項目を追加し、削除します。は、私はこのような親の質問の選択肢に無制限のお子様質問を追加および削除する機能を持つAngualrJSにフォームビルダを作成したいAngularJS
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
これはサンプルです私は動的に作成したいJSON:
{
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: {}
}
]
}
は今、私は他の子の質問の選択肢の中に子質問をプッシュする(のパスを取得)私のHTMLから選択肢を選択することができます方法を知りたいですか?
ルート質問を追加して処理し、さまざまな質問タイプのディレクティブを作成し、その選択を処理することができます –