angular.js - In angular, how to get the values of radio and checkbox under ng-reprat double-layer loop?
phpcn_u1582
phpcn_u1582 2017-06-13 09:22:52
0
2
1163

How to get the values of an ng-repeat radio and checkbox nested in ng-repeat? The code is as follows:

How to get input[radio] and input[checkbox] in double-layer ng-repeat? How should ng-model be set?

phpcn_u1582
phpcn_u1582

reply all (2)
扔个三星炸死你
$scope.result = {}; $scope.ques = { ques_items: [ { ques_item_type: 1, ques_item_id: 1, //问题id ques_item_options: [ { option_id: 'A', option_label: '测试1' }, { option_id: 'B', option_label: '测试2' }, { option_id: 'C', option_label: '测试3' }, { option_id: 'D', option_label: '测试4' } ] }, { ques_item_type: 2, ques_item_id: 2, ques_item_options: [ { option_id: 'A', option_label: '测试1' }, { option_id: 'B', option_label: '测试2' }, { option_id: 'C', option_label: '测试3' }, { option_id: 'D', option_label: '测试4' } ] }, { ques_item_type: 2, ques_item_id: 3, ques_item_options: [ { option_id: 'A', option_label: '测试1' }, { option_id: 'B', option_label: '测试2' }, { option_id: 'C', option_label: '测试3' }, { option_id: 'D', option_label: '测试4' } ] } ] }
result: {"1":"D","2":{"A":true,"B":true,"C":true,"D":true},"3":{"D":false}}
    刘奇

    I’ve been doing this recently too. If you have any problem with the value, please explain it in detail. You can also bind the model

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!