{"action":"opened","issue":{"url":"https://api.github.com/repos/formly-js/angular-formly-templates-bootstrap/issues/91","repository_url":"https://api.github.com/repos/formly-js/angular-formly-templates-bootstrap","labels_url":"https://api.github.com/repos/formly-js/angular-formly-templates-bootstrap/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/formly-js/angular-formly-templates-bootstrap/issues/91/comments","events_url":"https://api.github.com/repos/formly-js/angular-formly-templates-bootstrap/issues/91/events","html_url":"https://github.com/formly-js/angular-formly-templates-bootstrap/issues/91","id":139702135,"number":91,"title":"Multicheckbow is not working with JSON objects","user":{"login":"pjchartre","id":4265800,"avatar_url":"https://avatars.githubusercontent.com/u/4265800?v=3","gravatar_id":"","url":"https://api.github.com/users/pjchartre","html_url":"https://github.com/pjchartre","followers_url":"https://api.github.com/users/pjchartre/followers","following_url":"https://api.github.com/users/pjchartre/following{/other_user}","gists_url":"https://api.github.com/users/pjchartre/gists{/gist_id}","starred_url":"https://api.github.com/users/pjchartre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjchartre/subscriptions","organizations_url":"https://api.github.com/users/pjchartre/orgs","repos_url":"https://api.github.com/users/pjchartre/repos","events_url":"https://api.github.com/users/pjchartre/events{/privacy}","received_events_url":"https://api.github.com/users/pjchartre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-09T21:12:59Z","updated_at":"2016-03-09T21:12:59Z","closed_at":null,"body":"Issue similar to https://github.com/formly-js/angular-formly-templates-bootstrap/issues/88\r\n\r\nI fixed it in \r\nhttps://github.com/formly-js/angular-formly-templates-bootstrap/blob/26ec0f567172e4f0d75c61897312497b86118182/src/types/multiCheckbox.js#L36-L42\r\n\r\nreplacing\r\n\r\n`$scope.multiCheckbox.checked[index] = modelValue.indexOf(newOptionsValues[index][valueProp]) !== -1;`\r\n\r\nby\r\n\r\n`$scope.multiCheckbox.checked[index] = modelValue.map(function(t){return t[valueProp];}).indexOf(newOptionsValues[index][valueProp]) !== -1;`\r\n\r\nAnd in the setModel function\r\n\r\n   ```\r\nfunction setModel() {\r\n\t          $scope.model[opts.key] = [];\r\n\t          angular.forEach($scope.multiCheckbox.checked, function (checkbox, index) {\r\n\t            if (checkbox) {\r\n\t              $scope.model[opts.key].push(to.options[index]);\r\n\t            }\r\n\t          });\r\n```"}}