角代码:
$scope.qA = [ { question : ' question 1', answer: ['answer 1-1', 'answer1-2']},
{ question : ' question 2', answer: ['answer 2-1', 'answer2-2']}];
HTML(玉)代码
h1(ng-repeat='ques in qA.question') {{ques}}
p(ng-repeat='ans in qA[$index].answer']) {{ans}}
在第一个 ng-repeat 中,我想从 qA 中选择“问题”。在第二个 ng-repeat 中,我想为所选的“问题”选择每个答案。
上面的代码不起作用。怎么做到呢?