{"action":"created","issue":{"url":"https://api.github.com/repos/akempes/angular-rateit/issues/15","repository_url":"https://api.github.com/repos/akempes/angular-rateit","labels_url":"https://api.github.com/repos/akempes/angular-rateit/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/akempes/angular-rateit/issues/15/comments","events_url":"https://api.github.com/repos/akempes/angular-rateit/issues/15/events","html_url":"https://github.com/akempes/angular-rateit/issues/15","id":254142533,"number":15,"title":"Rated Function Fires on all instances","user":{"login":"selected-pixel-jameson","id":28204537,"avatar_url":"https://avatars0.githubusercontent.com/u/28204537?v=4","gravatar_id":"","url":"https://api.github.com/users/selected-pixel-jameson","html_url":"https://github.com/selected-pixel-jameson","followers_url":"https://api.github.com/users/selected-pixel-jameson/followers","following_url":"https://api.github.com/users/selected-pixel-jameson/following{/other_user}","gists_url":"https://api.github.com/users/selected-pixel-jameson/gists{/gist_id}","starred_url":"https://api.github.com/users/selected-pixel-jameson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selected-pixel-jameson/subscriptions","organizations_url":"https://api.github.com/users/selected-pixel-jameson/orgs","repos_url":"https://api.github.com/users/selected-pixel-jameson/repos","events_url":"https://api.github.com/users/selected-pixel-jameson/events{/privacy}","received_events_url":"https://api.github.com/users/selected-pixel-jameson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-30T21:33:33Z","updated_at":"2017-10-01T06:35:26Z","closed_at":null,"author_association":"NONE","body":"Hey just looking for some help here. I have this implemented in a ng-repeat and have the rated attribute pointing to a function on my controller, I.e. vm.postRating(item). When this fires it fires for every item in the collection of items that are contained within the my-repeat. Seems like it should just fire for the item that has just been rated. Not sure if I'm doing something wrong or not. Seems pretty straight forward."},"comment":{"url":"https://api.github.com/repos/akempes/angular-rateit/issues/comments/333357050","html_url":"https://github.com/akempes/angular-rateit/issues/15#issuecomment-333357050","issue_url":"https://api.github.com/repos/akempes/angular-rateit/issues/15","id":333357050,"user":{"login":"kostaskol","id":17071023,"avatar_url":"https://avatars0.githubusercontent.com/u/17071023?v=4","gravatar_id":"","url":"https://api.github.com/users/kostaskol","html_url":"https://github.com/kostaskol","followers_url":"https://api.github.com/users/kostaskol/followers","following_url":"https://api.github.com/users/kostaskol/following{/other_user}","gists_url":"https://api.github.com/users/kostaskol/gists{/gist_id}","starred_url":"https://api.github.com/users/kostaskol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kostaskol/subscriptions","organizations_url":"https://api.github.com/users/kostaskol/orgs","repos_url":"https://api.github.com/users/kostaskol/repos","events_url":"https://api.github.com/users/kostaskol/events{/privacy}","received_events_url":"https://api.github.com/users/kostaskol/received_events","type":"User","site_admin":false},"created_at":"2017-10-01T06:35:26Z","updated_at":"2017-10-01T06:35:26Z","author_association":"NONE","body":"I suppose you have something like this:\r\n```JavaScript\r\n<div ng-repeat=\"item in items\">\r\n       <ng-rate-it ... rated=\"myRatingFunc()\"></ng-rate-it>\r\n</div>\r\n```\r\nYou can clearly see that the \"myRatingFunc\" will have absolutely no idea as to which item has actually been rated.\r\nYou can change your code to the following\r\n```JavaScript\r\n<div ng-repeat=\"item in items\">\r\n       <ng-rate-it ... rated=\"myRatingFunc($index)\"></ng-rate-it>\r\n</div>\r\n```\r\n\r\nand in your controller:\r\n```JavaScript\r\n$scope.myRatingFunc = function(index) {\r\n       var ratedItem = $scope.items[index];\r\n       .... // Do what you will with that item\r\n}```\r\n"}}
{"actor":{"display_login":"kostaskol"}}