{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/10631","labels_url":"https://api.github.com/repos/angular/angular.js/issues/10631/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/10631/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/10631/events","html_url":"https://github.com/angular/angular.js/pull/10631","id":53326125,"number":10631,"title":"feat($timeout): pass arguments in callback","user":{"login":"gdi2290","id":1016365,"avatar_url":"https://avatars.githubusercontent.com/u/1016365?v=3","gravatar_id":"","url":"https://api.github.com/users/gdi2290","html_url":"https://github.com/gdi2290","followers_url":"https://api.github.com/users/gdi2290/followers","following_url":"https://api.github.com/users/gdi2290/following{/other_user}","gists_url":"https://api.github.com/users/gdi2290/gists{/gist_id}","starred_url":"https://api.github.com/users/gdi2290/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdi2290/subscriptions","organizations_url":"https://api.github.com/users/gdi2290/orgs","repos_url":"https://api.github.com/users/gdi2290/repos","events_url":"https://api.github.com/users/gdi2290/events{/privacy}","received_events_url":"https://api.github.com/users/gdi2290/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular.js/labels/1.4-candidate","name":"1.4-candidate","color":"fef2c0"},{"url":"https://api.github.com/repos/angular/angular.js/labels/cla%3A+yes","name":"cla: yes","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/83","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/83/labels","id":944245,"number":83,"title":"1.4.0-beta.2 / 1.3.11","description":"","creator":{"login":"pkozlowski-opensource","id":973550,"avatar_url":"https://avatars.githubusercontent.com/u/973550?v=3","gravatar_id":"","url":"https://api.github.com/users/pkozlowski-opensource","html_url":"https://github.com/pkozlowski-opensource","followers_url":"https://api.github.com/users/pkozlowski-opensource/followers","following_url":"https://api.github.com/users/pkozlowski-opensource/following{/other_user}","gists_url":"https://api.github.com/users/pkozlowski-opensource/gists{/gist_id}","starred_url":"https://api.github.com/users/pkozlowski-opensource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkozlowski-opensource/subscriptions","organizations_url":"https://api.github.com/users/pkozlowski-opensource/orgs","repos_url":"https://api.github.com/users/pkozlowski-opensource/repos","events_url":"https://api.github.com/users/pkozlowski-opensource/events{/privacy}","received_events_url":"https://api.github.com/users/pkozlowski-opensource/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":1,"state":"open","created_at":"2015-01-20T21:02:48Z","updated_at":"2015-01-21T21:51:46Z","due_on":"2015-01-25T23:00:00Z","closed_at":null},"comments":10,"created_at":"2015-01-04T05:38:22Z","updated_at":"2015-01-22T18:46:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/10631","html_url":"https://github.com/angular/angular.js/pull/10631","diff_url":"https://github.com/angular/angular.js/pull/10631.diff","patch_url":"https://github.com/angular/angular.js/pull/10631.patch"},"body":"PR has updated Docs and Tests\r\n`setTimeout` allows you to pass arguments into the callback function in\r\nthe …3rd argument. Since that’s taken I added it to the …4th\r\nhttp://mdn.io/setTimeout#Syntax\r\n\r\nhere is an example of why you would need to do this\r\n```javascript\r\nimport {$http} from 'angular.js/modules';\r\nimport {setTimeout, Promise} from 'facade/async';\r\nvar cache = {};\r\n\r\nexport class AwesomeModule {\r\n  static getSwag(url:string):Promise {\r\n    return new Promise(function(resolve, reject) {\r\n      var complete = function(data) {\r\n        cache[url] = data;\r\n        resolve(data);\r\n      };\r\n\r\n      if (url in cache) {\r\n        setTimeout(complete, 0, cache[url]);\r\n      } else {\r\n        $http.get(url).then(complete, reject);\r\n      } // end url in cache\r\n    });\r\n  } // end getSwag\r\n} // end AwesomeModule\r\n```\r\n\r\nsimilar pull request https://github.com/angular/angular.js/pull/10632"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/71074787","html_url":"https://github.com/angular/angular.js/pull/10631#issuecomment-71074787","issue_url":"https://api.github.com/repos/angular/angular.js/issues/10631","id":71074787,"user":{"login":"gdi2290","id":1016365,"avatar_url":"https://avatars.githubusercontent.com/u/1016365?v=3","gravatar_id":"","url":"https://api.github.com/users/gdi2290","html_url":"https://github.com/gdi2290","followers_url":"https://api.github.com/users/gdi2290/followers","following_url":"https://api.github.com/users/gdi2290/following{/other_user}","gists_url":"https://api.github.com/users/gdi2290/gists{/gist_id}","starred_url":"https://api.github.com/users/gdi2290/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdi2290/subscriptions","organizations_url":"https://api.github.com/users/gdi2290/orgs","repos_url":"https://api.github.com/users/gdi2290/repos","events_url":"https://api.github.com/users/gdi2290/events{/privacy}","received_events_url":"https://api.github.com/users/gdi2290/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T18:46:22Z","updated_at":"2015-01-22T18:46:22Z","body":"I pushed up changes to mock to reflect the `$interval` in order to get this merged. There are a few ways this can be solved\r\n\r\n* Refactoring to expose private methods `setInterval` and `clearInterval` so we can use a decorator similar to how [ngMocks/$timeout#L1713](https://github.com/angular/angular.js/blob/master/src/ngMock/angular-mocks.js#L1713) is handled in Angular 1.x or Angular 2 with [facade/async.es6#L39](https://github.com/angular/angular/blob/master/modules/facade/src/async.es6#L39)\r\n* Hack Jasmine/tests to repeat the tests for mock/real \r\n* Update the build system to run tests for mocks/real (not sure if mocks are included into docs tests but again I have Java errors) \r\n\r\neither one that's chosen I think a new PR would make sense for that change while this one should be good"}}