Ich versuche, Json Daten mit ng-repeat
. Die Webseite wird jedoch entweder als weiße Seite oder als leere Seite angezeigt.wie JSON-Daten mit ng-repeat anzuzeigen?
Die Json:
{
"questions": {
"q1": {
"qText": " question1",
"result":"result1",
"options":{
"A":"option1",
"N":"option2",
"D":"otpion3",
"NA":"option4"
}
},
"q2": {
"qText": " question2",
"result":"result2",
"options":{
"A":"option1",
"N":"option2",
"D":"otpion3",
"NA":"option4"
}
},
"q3": {
"qText": " question3",
"result":"result3",
"options":{
"A":"option1",
"N":"option2",
"D":"otpion3",
"NA":"option4"
}
},
"q4": {
"qText": " question4",
"result":"result4",
"options":{
"A":"option1",
"N":"option2",
"D":"otpion3",
"NA":"option4"
}
},
"q5": {
"qText": " question5",
"result":"result5",
"options":{
"A":"option1",
"N":"option2",
"D":"otpion3",
"NA":"option4"
}
},
"q6": {
"qText": " question6",
"result":"result6",
"options":{
"A":"option1",
"N":"option2",
"D":"otpion3",
"NA":"option4"
}
}
}
}
}
Die HTML:
<div ng-repeat="question in questions track by $index">
<div class="q1">
<p>{{question.qText}}</p>
<input type="radio" ng-model="qobj.q1" ng-value="'A'" ><label>{{question.options.A}}</label>
<input type="radio" ng-model="qobj.q1" ng-value="'N'" ><label>{{question.options.N}}</label>
<input type="radio" ng-model="qobj.q1" ng-value="'D'" ><label>{{question.options.D}}</label>
<input type="radio" ng-model="qobj.q1" ng-value="'NA'" ><label>{{question.options.NA}}</label>
</div>
</div>
Und deine Frage ist? –
onclick submit alle Eingabewerte erhalten und im Objekt gespeichert Wie kann ich tun? –