{"comment":{"url":"https://api.github.com/repos/theblindspring/tatoeba2/comments/18102401","html_url":"https://github.com/theblindspring/tatoeba2/commit/107bd7ef12638e14c053e80a628e881f8fd037f2#commitcomment-18102401","id":18102401,"user":{"login":"trang","id":221850,"avatar_url":"https://avatars.githubusercontent.com/u/221850?v=3","gravatar_id":"","url":"https://api.github.com/users/trang","html_url":"https://github.com/trang","followers_url":"https://api.github.com/users/trang/followers","following_url":"https://api.github.com/users/trang/following{/other_user}","gists_url":"https://api.github.com/users/trang/gists{/gist_id}","starred_url":"https://api.github.com/users/trang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trang/subscriptions","organizations_url":"https://api.github.com/users/trang/orgs","repos_url":"https://api.github.com/users/trang/repos","events_url":"https://api.github.com/users/trang/events{/privacy}","received_events_url":"https://api.github.com/users/trang/received_events","type":"User","site_admin":false},"position":50,"line":50,"path":"app/webroot/js/favorites/of.ctrl.js","commit_id":"107bd7ef12638e14c053e80a628e881f8fd037f2","created_at":"2016-07-01T22:09:35Z","updated_at":"2016-07-01T22:09:35Z","body":"There shouldn't be a `return` for `toggleFavorite()`. The function isn't supposed to return anything since you call it on click.\r\n\r\nYou'll notice as well that the loader doesn't appear at all. That's because the function that you have in `.then()` is not correct.\r\n\r\n`.then()` takes a function that has a parameter which is the result of your service.\r\nSo you cannot just pass `changeFavoriteElements()` directly into `.then()`.\r\nYou need to pass a function that will execute `changeFavoriteElements()`.\r\n\r\n```\r\nsetFavoriteService.setFavorite(action, vm.sentenceId).then(\r\n    function(response) {\r\n        changeFavoriteElements(replaceText, style);\r\n    }\r\n);\r\n```"}}
{"actor":{"display_login":"trang"}}