{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/12047","labels_url":"https://api.github.com/repos/angular/angular.js/issues/12047/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/12047/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/12047/events","html_url":"https://github.com/angular/angular.js/issues/12047","id":85963997,"number":12047,"title":"$scope inside nested callbacks","user":{"login":"brunocascio","id":2397875,"avatar_url":"https://avatars.githubusercontent.com/u/2397875?v=3","gravatar_id":"","url":"https://api.github.com/users/brunocascio","html_url":"https://github.com/brunocascio","followers_url":"https://api.github.com/users/brunocascio/followers","following_url":"https://api.github.com/users/brunocascio/following{/other_user}","gists_url":"https://api.github.com/users/brunocascio/gists{/gist_id}","starred_url":"https://api.github.com/users/brunocascio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunocascio/subscriptions","organizations_url":"https://api.github.com/users/brunocascio/orgs","repos_url":"https://api.github.com/users/brunocascio/repos","events_url":"https://api.github.com/users/brunocascio/events{/privacy}","received_events_url":"https://api.github.com/users/brunocascio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-07T23:41:49Z","updated_at":"2015-06-08T11:24:30Z","closed_at":null,"body":"```\r\nDB.messages().all(function(err, cursor){\r\n\r\n    $scope.messages = [{text:'pepito!'}]; // here work\r\n\r\n    cursor.toArray(function(err, msgs){\r\n        $scope.messages = [{text: 'pepito'}]; // here not work\r\n    });\r\n  });\r\n```\r\n\r\nNote: I use angular 1.3.16"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/109956530","html_url":"https://github.com/angular/angular.js/issues/12047#issuecomment-109956530","issue_url":"https://api.github.com/repos/angular/angular.js/issues/12047","id":109956530,"user":{"login":"Narretz","id":1153097,"avatar_url":"https://avatars.githubusercontent.com/u/1153097?v=3","gravatar_id":"","url":"https://api.github.com/users/Narretz","html_url":"https://github.com/Narretz","followers_url":"https://api.github.com/users/Narretz/followers","following_url":"https://api.github.com/users/Narretz/following{/other_user}","gists_url":"https://api.github.com/users/Narretz/gists{/gist_id}","starred_url":"https://api.github.com/users/Narretz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narretz/subscriptions","organizations_url":"https://api.github.com/users/Narretz/orgs","repos_url":"https://api.github.com/users/Narretz/repos","events_url":"https://api.github.com/users/Narretz/events{/privacy}","received_events_url":"https://api.github.com/users/Narretz/received_events","type":"User","site_admin":false},"created_at":"2015-06-08T11:24:30Z","updated_at":"2015-06-08T11:24:30Z","body":"what is DB.messages()? It might be that the callbacks are not executed inside an angular app context, so you need to call `scope.$apply()`."}}