This would be more easier question but I am stuck on some small simple thing: My angular object is like this:
$scope.questions = [
{
questionText: "1. This is a test question#1",
choices: [{
id: 1,
text: "NO",
isUserAnswer: false
}, {
id: 2,
text: "YES",
isUserAnswer: true
}]
},
{
questionText: "2. This is a test question#2",
choices: [{
id: 1,
text: "NO",
isUserAnswer: false
}, {
id: 2,
text: "YES",
isUserAnswer: true
}]
}
];
Now I am trying to populate my frontend (jade/html) using this object so that I can have two radio buttons for each questions. My jade file is like this:
div
ul.unstyled
li(ng-repeat='question in questions')
strong.question {{question.questionText}}
ul.unstyled(id='quest_{{$parent.$index}}')
li(ng-repeat='choice in question.choices')
label.(class='isCorrect_{{choice.selected}}', for='quest_{{$parent.$index}}_choice_{{$index}}')
input(type='radio', id='quest_{{$parent.index}}_choice_{{$index}}', ng-model='choices[$parent.$index]', value='{{choice.text}}', name='quest_{{$parent.$index}}_choices', ng-click='showResult()')
| {{choice.text}}
Now I can see the questions and radio buttons on the html page but somehow I am unable to perform click on any of the button. Any obvious reason? Any help would be appreciated. It works perfect when I change to html file.