angularjs - save data from checkbox into mongoose using MEAN stack -


i have developped these lines save selected data checkbox mongoose in html file

 <label ng-repeat="role in roles">    <input type="checkbox" checklist-model="user.roles" checklist-value="role.id"> {{role.text}}     </label> 

in controller file info.js

  $scope.roles = [ {id: 1, text: 'guest'}, {id: 2, text: 'user'}, {id: 3, text: 'customer'}, {id: 4, text: 'admin'}  ];  $scope.user = {   roles: [1,2,3,4]  };  langage: $scope.user.roles; 

in app.js

var langage1= req.body.langage; console.log (langage1); 

when run program have message in conole : roles: [ 1, 2, 3, 4 ] while want selected label


Comments