Currently, I am working on a project where I am using 3 nested ng-repeat to read a JSON file and display various questions along with their answers. Everything seems to be working fine up to this point, but I am facing an issue with storing the selected answers and sending them to the API. For some reason, the selected answers are not being stored.
Below is a snippet of my view:
<form>
<div class="panel panel-default" ng-repeat="section in questionsTest">
<div class="panel-heading">
<h1>{{ section.name }}</h1>
<h3 class="panel-title">{{ section.name }}. {{
section.description }}</h3>
</div>
<div class="panel-body" ng-repeat="question in section.questions">
{{ question.statement }}
<div ng-repeat="answer in question.answers">
<label class="radio-inline"> <input type="{{ answer.type }}" ng-model="question.valor"
name="{{ question.id }}" id="{{ answer.id }}" value="{{ answer.id }}">
{{ answer.valor }}
</label>
</div>
</div>
</div>
</form>
And here is a snippet of the controller:
$scope.question = {};
$scope.testing = function(){
console.log($scope.question);
};
The $scope.testing function is used for testing purposes to view the value of $scope.question in the console.