{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/material/issues/8410","repository_url":"https://api.github.com/repos/angular/material","labels_url":"https://api.github.com/repos/angular/material/issues/8410/labels{/name}","comments_url":"https://api.github.com/repos/angular/material/issues/8410/comments","events_url":"https://api.github.com/repos/angular/material/issues/8410/events","html_url":"https://github.com/angular/material/issues/8410","id":154239105,"number":8410,"title":"Checkbox won't check previous selected item","user":{"login":"lolaswift","id":5462925,"avatar_url":"https://avatars.githubusercontent.com/u/5462925?v=3","gravatar_id":"","url":"https://api.github.com/users/lolaswift","html_url":"https://github.com/lolaswift","followers_url":"https://api.github.com/users/lolaswift/followers","following_url":"https://api.github.com/users/lolaswift/following{/other_user}","gists_url":"https://api.github.com/users/lolaswift/gists{/gist_id}","starred_url":"https://api.github.com/users/lolaswift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolaswift/subscriptions","organizations_url":"https://api.github.com/users/lolaswift/orgs","repos_url":"https://api.github.com/users/lolaswift/repos","events_url":"https://api.github.com/users/lolaswift/events{/privacy}","received_events_url":"https://api.github.com/users/lolaswift/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-11T13:07:43Z","updated_at":"2016-05-11T19:44:58Z","closed_at":"2016-05-11T19:44:58Z","body":"Dear team,\r\n\r\nI have a md-checkbox in a ng-repeat. It works fine, but when loading the page again, with some presets saved, it won't load checkbox as selected for the options that were selected and saved previously (ng check doesn't work on it). \r\n\r\nI implemented my app by learning from this example https://material.angularjs.org/latest/demo/checkbox, the \"syncing\" demo.\r\n\r\nIn the example, it works:\r\n```\r\n    $scope.items = [1,2,3,4,5];\r\n    $scope.selected = [1,2];\r\n```\r\n\r\nIn my case, it doesn't work because I pass object instead of pure string:\r\n```\r\n    $scope.items = [object1, object2, object3],\r\n    $scope.selected = [object1]\r\n```\r\nFor example, change the demo to use:\r\n```\r\n   $scope.items = [{id:\"1\", name:\"hah\"},{id:\"2\", name:\"nah\"}];\r\n    $scope.selected = [{id:\"1\", name:\"hah\"}];\r\n```\r\nOn the html, use item.name to display only the name\r\n```\r\n    <div flex=\"50\" ng-repeat=\"item in items\">\r\n              <md-checkbox ng-checked=\"exists(item, selected)\" ng-click=\"toggle(item, selected)\">\r\n                {{ item.name }} <span ng-if=\"exists(item, selected)\">selected</span>\r\n              </md-checkbox>\r\n     </div>\r\n```\r\n\r\nMd-checkbox thinks object 1 of $scope.items and object1 of $scope.selected are different even if I construct them the same. There is some $$hashkey stuff i noticed is never the same. If I strip off my objects and make an array of strings just like the demo, it works. Is this the designed behavior or I am doing something completely stupid or wrong?  Md-select use ng-model and track by id, is there anything similar in md-checkbox?\r\n\r\nMy apology if this is not an issue and it's just a usage question, then I should ask on stack overflow.\r\n\r\nAgain, thanks for giving us the amazing product.\r\n\r\nRegards,\r\nLola\r\n\r\n"}}