search

Home  >  Q&A  >  body text

angular.js - How to pass value to checkbox in angularjs

There is an array

 $scope.colors = [{
                        'id':'1',
                        'name':'red'
                    },{
                        'id':'2',
                        'name':'green'
                    },{
                        'id':'3',
                        'name':'blue'
                    }];

How to generate a set of checkboxes and post them to the backend in the format clors:[{id:1}...]

仅有的幸福仅有的幸福2863 days ago676

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-15 16:55:24

    I took a look. You can take a look at a demo I wrote. It may be helpful to you.

    reply
    0
  • Cancelreply