I am working on developing a web page from past 4 days with AngularJS and Java. I'm consuming a REST service to get a Map of checklist description as :

{checklist:{'sample1': true, 'sample2': false, 'sample3': true}}

I am trying to populate the above map as a checklist with description from keys and checklist values from value of the map which I was able to get it to working. However, I want to update this checklist in the same page and update it via a post request to the REST resource. I am familiar with handling the object on the back-end and assigning it. But as I am a newbie to angular I'm unable to figure out how this can be done. Can anyone please help me figure this out? My code is as follows


.controller('MyCtrl', ['$scope','CheckFactory', function ($scope,CheckFactory) {
  CheckFactory.query({}, function (data){
service :
factory('CheckFactory', ['$resource', function ($resource) {
  return $resource('#myRESTendpoint', {}, {
    query: { method: 'GET', params:{} }
I have configured my app.js accordingly and my HTML :

<label ng-repeat="(key,data) in sample"> 
  <input type="checkbox" ng-model="sample[key]"/>