{"action":"created","comment":{"url":"https://api.github.com/repos/neroma/neroma-chat/pulls/comments/32010849","id":32010849,"diff_hunk":"@@ -7,33 +7,20 @@ chat.factory('Messages', function(socket, _) {\n     var success = socket.emit('send', data);\n   };\n \n-  var registerScope = function(scope) {\n-    scopes.push(scope);\n-  };\n-\n-  var unregisterScope = function(scope) {\n-    _.remove(scopes, scope);\n-  };\n-\n   socket.on('message', function(message) {\n     services.data.push(message);\n-\n-    _.each(scopes, function(scope) { scope.$apply(); });\n+    $rootScope.$apply();","path":"statics/js/message.js","position":22,"original_position":22,"commit_id":"9724269aa73f3f0c247493632f5a56f0a8ca178b","original_commit_id":"9724269aa73f3f0c247493632f5a56f0a8ca178b","user":{"login":"rongduan-zhu","id":5406634,"avatar_url":"https://avatars.githubusercontent.com/u/5406634?v=3","gravatar_id":"","url":"https://api.github.com/users/rongduan-zhu","html_url":"https://github.com/rongduan-zhu","followers_url":"https://api.github.com/users/rongduan-zhu/followers","following_url":"https://api.github.com/users/rongduan-zhu/following{/other_user}","gists_url":"https://api.github.com/users/rongduan-zhu/gists{/gist_id}","starred_url":"https://api.github.com/users/rongduan-zhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rongduan-zhu/subscriptions","organizations_url":"https://api.github.com/users/rongduan-zhu/orgs","repos_url":"https://api.github.com/users/rongduan-zhu/repos","events_url":"https://api.github.com/users/rongduan-zhu/events{/privacy}","received_events_url":"https://api.github.com/users/rongduan-zhu/received_events","type":"User","site_admin":false},"body":"I think $rootScope.$apply() is more clearer. ","created_at":"2015-06-09T13:16:52Z","updated_at":"2015-06-09T13:16:52Z","html_url":"https://github.com/neroma/neroma-chat/pull/4#discussion_r32010849","pull_request_url":"https://api.github.com/repos/neroma/neroma-chat/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/neroma/neroma-chat/pulls/comments/32010849"},"html":{"href":"https://github.com/neroma/neroma-chat/pull/4#discussion_r32010849"},"pull_request":{"href":"https://api.github.com/repos/neroma/neroma-chat/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/neroma/neroma-chat/pulls/4","id":37233389,"html_url":"https://github.com/neroma/neroma-chat/pull/4","diff_url":"https://github.com/neroma/neroma-chat/pull/4.diff","patch_url":"https://github.com/neroma/neroma-chat/pull/4.patch","issue_url":"https://api.github.com/repos/neroma/neroma-chat/issues/4","number":4,"state":"open","locked":false,"title":"using rootscope apply instead","user":{"login":"rongduan-zhu","id":5406634,"avatar_url":"https://avatars.githubusercontent.com/u/5406634?v=3","gravatar_id":"","url":"https://api.github.com/users/rongduan-zhu","html_url":"https://github.com/rongduan-zhu","followers_url":"https://api.github.com/users/rongduan-zhu/followers","following_url":"https://api.github.com/users/rongduan-zhu/following{/other_user}","gists_url":"https://api.github.com/users/rongduan-zhu/gists{/gist_id}","starred_url":"https://api.github.com/users/rongduan-zhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rongduan-zhu/subscriptions","organizations_url":"https://api.github.com/users/rongduan-zhu/orgs","repos_url":"https://api.github.com/users/rongduan-zhu/repos","events_url":"https://api.github.com/users/rongduan-zhu/events{/privacy}","received_events_url":"https://api.github.com/users/rongduan-zhu/received_events","type":"User","site_admin":false},"body":"@neroma/owners \r\nDoing this instead of repeatedly applying to all scopes because it yields the same results as all controller scopes inherit rootscope","created_at":"2015-06-09T09:14:17Z","updated_at":"2015-06-09T13:16:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a30d444f6ee9be2870bf57195d951b33ccba4248","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neroma/neroma-chat/pulls/4/commits","review_comments_url":"https://api.github.com/repos/neroma/neroma-chat/pulls/4/comments","review_comment_url":"https://api.github.com/repos/neroma/neroma-chat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neroma/neroma-chat/issues/4/comments","statuses_url":"https://api.github.com/repos/neroma/neroma-chat/statuses/9724269aa73f3f0c247493632f5a56f0a8ca178b","head":{"label":"neroma:rz/scope-fix","ref":"rz/scope-fix","sha":"9724269aa73f3f0c247493632f5a56f0a8ca178b","user":{"login":"neroma","id":12774950,"avatar_url":"https://avatars.githubusercontent.com/u/12774950?v=3","gravatar_id":"","url":"https://api.github.com/users/neroma","html_url":"https://github.com/neroma","followers_url":"https://api.github.com/users/neroma/followers","following_url":"https://api.github.com/users/neroma/following{/other_user}","gists_url":"https://api.github.com/users/neroma/gists{/gist_id}","starred_url":"https://api.github.com/users/neroma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neroma/subscriptions","organizations_url":"https://api.github.com/users/neroma/orgs","repos_url":"https://api.github.com/users/neroma/repos","events_url":"https://api.github.com/users/neroma/events{/privacy}","received_events_url":"https://api.github.com/users/neroma/received_events","type":"Organization","site_admin":false},"repo":{"id":36981136,"name":"neroma-chat","full_name":"neroma/neroma-chat","owner":{"login":"neroma","id":12774950,"avatar_url":"https://avatars.githubusercontent.com/u/12774950?v=3","gravatar_id":"","url":"https://api.github.com/users/neroma","html_url":"https://github.com/neroma","followers_url":"https://api.github.com/users/neroma/followers","following_url":"https://api.github.com/users/neroma/following{/other_user}","gists_url":"https://api.github.com/users/neroma/gists{/gist_id}","starred_url":"https://api.github.com/users/neroma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neroma/subscriptions","organizations_url":"https://api.github.com/users/neroma/orgs","repos_url":"https://api.github.com/users/neroma/repos","events_url":"https://api.github.com/users/neroma/events{/privacy}","received_events_url":"https://api.github.com/users/neroma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neroma/neroma-chat","description":"","fork":false,"url":"https://api.github.com/repos/neroma/neroma-chat","forks_url":"https://api.github.com/repos/neroma/neroma-chat/forks","keys_url":"https://api.github.com/repos/neroma/neroma-chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neroma/neroma-chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neroma/neroma-chat/teams","hooks_url":"https://api.github.com/repos/neroma/neroma-chat/hooks","issue_events_url":"https://api.github.com/repos/neroma/neroma-chat/issues/events{/number}","events_url":"https://api.github.com/repos/neroma/neroma-chat/events","assignees_url":"https://api.github.com/repos/neroma/neroma-chat/assignees{/user}","branches_url":"https://api.github.com/repos/neroma/neroma-chat/branches{/branch}","tags_url":"https://api.github.com/repos/neroma/neroma-chat/tags","blobs_url":"https://api.github.com/repos/neroma/neroma-chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neroma/neroma-chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neroma/neroma-chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/neroma/neroma-chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neroma/neroma-chat/statuses/{sha}","languages_url":"https://api.github.com/repos/neroma/neroma-chat/languages","stargazers_url":"https://api.github.com/repos/neroma/neroma-chat/stargazers","contributors_url":"https://api.github.com/repos/neroma/neroma-chat/contributors","subscribers_url":"https://api.github.com/repos/neroma/neroma-chat/subscribers","subscription_url":"https://api.github.com/repos/neroma/neroma-chat/subscription","commits_url":"https://api.github.com/repos/neroma/neroma-chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/neroma/neroma-chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/neroma/neroma-chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/neroma/neroma-chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/neroma/neroma-chat/contents/{+path}","compare_url":"https://api.github.com/repos/neroma/neroma-chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neroma/neroma-chat/merges","archive_url":"https://api.github.com/repos/neroma/neroma-chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neroma/neroma-chat/downloads","issues_url":"https://api.github.com/repos/neroma/neroma-chat/issues{/number}","pulls_url":"https://api.github.com/repos/neroma/neroma-chat/pulls{/number}","milestones_url":"https://api.github.com/repos/neroma/neroma-chat/milestones{/number}","notifications_url":"https://api.github.com/repos/neroma/neroma-chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neroma/neroma-chat/labels{/name}","releases_url":"https://api.github.com/repos/neroma/neroma-chat/releases{/id}","created_at":"2015-06-06T13:34:31Z","updated_at":"2015-06-06T13:56:31Z","pushed_at":"2015-06-09T09:14:18Z","git_url":"git://github.com/neroma/neroma-chat.git","ssh_url":"git@github.com:neroma/neroma-chat.git","clone_url":"https://github.com/neroma/neroma-chat.git","svn_url":"https://github.com/neroma/neroma-chat","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"neroma:master","ref":"master","sha":"274c0a833d2e70e8dafe1752025d82c5441b974e","user":{"login":"neroma","id":12774950,"avatar_url":"https://avatars.githubusercontent.com/u/12774950?v=3","gravatar_id":"","url":"https://api.github.com/users/neroma","html_url":"https://github.com/neroma","followers_url":"https://api.github.com/users/neroma/followers","following_url":"https://api.github.com/users/neroma/following{/other_user}","gists_url":"https://api.github.com/users/neroma/gists{/gist_id}","starred_url":"https://api.github.com/users/neroma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neroma/subscriptions","organizations_url":"https://api.github.com/users/neroma/orgs","repos_url":"https://api.github.com/users/neroma/repos","events_url":"https://api.github.com/users/neroma/events{/privacy}","received_events_url":"https://api.github.com/users/neroma/received_events","type":"Organization","site_admin":false},"repo":{"id":36981136,"name":"neroma-chat","full_name":"neroma/neroma-chat","owner":{"login":"neroma","id":12774950,"avatar_url":"https://avatars.githubusercontent.com/u/12774950?v=3","gravatar_id":"","url":"https://api.github.com/users/neroma","html_url":"https://github.com/neroma","followers_url":"https://api.github.com/users/neroma/followers","following_url":"https://api.github.com/users/neroma/following{/other_user}","gists_url":"https://api.github.com/users/neroma/gists{/gist_id}","starred_url":"https://api.github.com/users/neroma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neroma/subscriptions","organizations_url":"https://api.github.com/users/neroma/orgs","repos_url":"https://api.github.com/users/neroma/repos","events_url":"https://api.github.com/users/neroma/events{/privacy}","received_events_url":"https://api.github.com/users/neroma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neroma/neroma-chat","description":"","fork":false,"url":"https://api.github.com/repos/neroma/neroma-chat","forks_url":"https://api.github.com/repos/neroma/neroma-chat/forks","keys_url":"https://api.github.com/repos/neroma/neroma-chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neroma/neroma-chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neroma/neroma-chat/teams","hooks_url":"https://api.github.com/repos/neroma/neroma-chat/hooks","issue_events_url":"https://api.github.com/repos/neroma/neroma-chat/issues/events{/number}","events_url":"https://api.github.com/repos/neroma/neroma-chat/events","assignees_url":"https://api.github.com/repos/neroma/neroma-chat/assignees{/user}","branches_url":"https://api.github.com/repos/neroma/neroma-chat/branches{/branch}","tags_url":"https://api.github.com/repos/neroma/neroma-chat/tags","blobs_url":"https://api.github.com/repos/neroma/neroma-chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neroma/neroma-chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neroma/neroma-chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/neroma/neroma-chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neroma/neroma-chat/statuses/{sha}","languages_url":"https://api.github.com/repos/neroma/neroma-chat/languages","stargazers_url":"https://api.github.com/repos/neroma/neroma-chat/stargazers","contributors_url":"https://api.github.com/repos/neroma/neroma-chat/contributors","subscribers_url":"https://api.github.com/repos/neroma/neroma-chat/subscribers","subscription_url":"https://api.github.com/repos/neroma/neroma-chat/subscription","commits_url":"https://api.github.com/repos/neroma/neroma-chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/neroma/neroma-chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/neroma/neroma-chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/neroma/neroma-chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/neroma/neroma-chat/contents/{+path}","compare_url":"https://api.github.com/repos/neroma/neroma-chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neroma/neroma-chat/merges","archive_url":"https://api.github.com/repos/neroma/neroma-chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neroma/neroma-chat/downloads","issues_url":"https://api.github.com/repos/neroma/neroma-chat/issues{/number}","pulls_url":"https://api.github.com/repos/neroma/neroma-chat/pulls{/number}","milestones_url":"https://api.github.com/repos/neroma/neroma-chat/milestones{/number}","notifications_url":"https://api.github.com/repos/neroma/neroma-chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neroma/neroma-chat/labels{/name}","releases_url":"https://api.github.com/repos/neroma/neroma-chat/releases{/id}","created_at":"2015-06-06T13:34:31Z","updated_at":"2015-06-06T13:56:31Z","pushed_at":"2015-06-09T09:14:18Z","git_url":"git://github.com/neroma/neroma-chat.git","ssh_url":"git@github.com:neroma/neroma-chat.git","clone_url":"https://github.com/neroma/neroma-chat.git","svn_url":"https://github.com/neroma/neroma-chat","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neroma/neroma-chat/pulls/4"},"html":{"href":"https://github.com/neroma/neroma-chat/pull/4"},"issue":{"href":"https://api.github.com/repos/neroma/neroma-chat/issues/4"},"comments":{"href":"https://api.github.com/repos/neroma/neroma-chat/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/neroma/neroma-chat/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/neroma/neroma-chat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neroma/neroma-chat/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/neroma/neroma-chat/statuses/9724269aa73f3f0c247493632f5a56f0a8ca178b"}}}}