{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular/pulls/comments/94086854","pull_request_review_id":14617514,"id":94086854,"diff_hunk":"@@ -149,27 +201,27 @@ export class MockBackend implements ConnectionBackend {\n    * ### Example\n    *\n    * ```\n-   * import {Http, BaseRequestOptions, Response} from '@angular/http';\n-   * import {MockBackend} from '@angular/http/testing';\n-   * import {Injector, provide} from '@angular/core';\n-   *\n-   * it('should get a response', () => {\n-   *   var connection; //this will be set when a new connection is emitted from the backend.\n-   *   var text; //this will be set from mock response\n-   *   var injector = Injector.resolveAndCreate([\n-   *     MockBackend,\n-   *     {provide: Http, useFactory: (backend, options) => {\n-   *       return new Http(backend, options);\n-   *     }, deps: [MockBackend, BaseRequestOptions]}]);\n-   *   var backend = injector.get(MockBackend);\n+   * import { Http, BaseRequestOptions, Response, ConnectionBackend, ResponseOptions, RequestOptions} from '@angular/http';\n+   * import { MockBackend, MockConnection} from '@angular/http/testing';\n+   * import { ReflectiveInjector} from '@angular/core';\n+   * import { fakeAsync, tick } from '@angular/core/testing';\n+   * \n+   * it('should get a response', fakeAsync(() => {\n+   *   var connection : MockConnection; //this will be set when a new connection is emitted from the backend.","path":"modules/@angular/http/testing/mock_backend.ts","position":null,"original_position":119,"commit_id":"65581665d4151c2c2488abbfe8066b2b258a31c1","original_commit_id":"0524648d71b73d7d3a7ee35f5863c08306265c62","user":{"login":"e-hein","id":10928248,"avatar_url":"https://avatars.githubusercontent.com/u/10928248?v=3","gravatar_id":"","url":"https://api.github.com/users/e-hein","html_url":"https://github.com/e-hein","followers_url":"https://api.github.com/users/e-hein/followers","following_url":"https://api.github.com/users/e-hein/following{/other_user}","gists_url":"https://api.github.com/users/e-hein/gists{/gist_id}","starred_url":"https://api.github.com/users/e-hein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-hein/subscriptions","organizations_url":"https://api.github.com/users/e-hein/orgs","repos_url":"https://api.github.com/users/e-hein/repos","events_url":"https://api.github.com/users/e-hein/events{/privacy}","received_events_url":"https://api.github.com/users/e-hein/received_events","type":"User","site_admin":false},"body":"changed","created_at":"2016-12-28T23:03:41Z","updated_at":"2016-12-28T23:03:42Z","html_url":"https://github.com/angular/angular/pull/13689#discussion_r94086854","pull_request_url":"https://api.github.com/repos/angular/angular/pulls/13689","_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/comments/94086854"},"html":{"href":"https://github.com/angular/angular/pull/13689#discussion_r94086854"},"pull_request":{"href":"https://api.github.com/repos/angular/angular/pulls/13689"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/13689","id":99556507,"html_url":"https://github.com/angular/angular/pull/13689","diff_url":"https://github.com/angular/angular/pull/13689.diff","patch_url":"https://github.com/angular/angular/pull/13689.patch","issue_url":"https://api.github.com/repos/angular/angular/issues/13689","number":13689,"state":"open","locked":false,"title":"docs(Http): fix and extend samples for testing/MockBackend","user":{"login":"e-hein","id":10928248,"avatar_url":"https://avatars.githubusercontent.com/u/10928248?v=3","gravatar_id":"","url":"https://api.github.com/users/e-hein","html_url":"https://github.com/e-hein","followers_url":"https://api.github.com/users/e-hein/followers","following_url":"https://api.github.com/users/e-hein/following{/other_user}","gists_url":"https://api.github.com/users/e-hein/gists{/gist_id}","starred_url":"https://api.github.com/users/e-hein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-hein/subscriptions","organizations_url":"https://api.github.com/users/e-hein/orgs","repos_url":"https://api.github.com/users/e-hein/repos","events_url":"https://api.github.com/users/e-hein/events{/privacy}","received_events_url":"https://api.github.com/users/e-hein/received_events","type":"User","site_admin":false},"body":"Fix samples for MockBackend and MockBackend.connections that were outdated. Also extend central sample for MockBackend to ease getting started.\r\n\r\n**Please check if the PR fulfills these requirements**\r\n- [x] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit\r\n- [ ] Tests for the changes have been added (for bug fixes / features)\r\n- [x] Docs have been added / updated (for bug fixes / features)\r\n\r\n\r\n**What kind of change does this PR introduce?** (check one with \"x\")\r\n```\r\n[ ] Bugfix\r\n[ ] Feature\r\n[ ] Code style update (formatting, local variables)\r\n[ ] Refactoring (no functional changes, no api changes)\r\n[ ] Build related changes\r\n[ ] CI related changes\r\n[x] Other... Please describe: Sample code in docs fixed\r\n```\r\n\r\n**What is the current behavior?** (You can also link to an open issue here)\r\n- sample code crashes because of api changes (e.g. Injector there's no method Injector.resolveAndCreate anymore - moved to ReflectiveInjector)\r\n\r\n**What is the new behavior?**\r\n- sample code is runnable again\r\n- refactoring to use some framework helper (fakeAsync) and try to improve readability\r\n\r\n**Does this PR introduce a breaking change?** (check one with \"x\")\r\n```\r\n[ ] Yes\r\n[x] No\r\n```\r\n\r\nIf this PR contains a breaking change, please describe the impact and migration path for existing applications: ...\r\n\r\n\r\n**Other information**:\r\nThanks for the original sample - helped me a lot testing http connections. Hope the updated sample will help even more people.\r\n","created_at":"2016-12-28T14:46:06Z","updated_at":"2016-12-28T23:03:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2f69719c080e9390118fc3535d9fb35c8717a7f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/angular/angular/pulls/13689/commits","review_comments_url":"https://api.github.com/repos/angular/angular/pulls/13689/comments","review_comment_url":"https://api.github.com/repos/angular/angular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular/issues/13689/comments","statuses_url":"https://api.github.com/repos/angular/angular/statuses/65581665d4151c2c2488abbfe8066b2b258a31c1","head":{"label":"e-hein:master","ref":"master","sha":"65581665d4151c2c2488abbfe8066b2b258a31c1","user":{"login":"e-hein","id":10928248,"avatar_url":"https://avatars.githubusercontent.com/u/10928248?v=3","gravatar_id":"","url":"https://api.github.com/users/e-hein","html_url":"https://github.com/e-hein","followers_url":"https://api.github.com/users/e-hein/followers","following_url":"https://api.github.com/users/e-hein/following{/other_user}","gists_url":"https://api.github.com/users/e-hein/gists{/gist_id}","starred_url":"https://api.github.com/users/e-hein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-hein/subscriptions","organizations_url":"https://api.github.com/users/e-hein/orgs","repos_url":"https://api.github.com/users/e-hein/repos","events_url":"https://api.github.com/users/e-hein/events{/privacy}","received_events_url":"https://api.github.com/users/e-hein/received_events","type":"User","site_admin":false},"repo":{"id":77533910,"name":"angular","full_name":"e-hein/angular","owner":{"login":"e-hein","id":10928248,"avatar_url":"https://avatars.githubusercontent.com/u/10928248?v=3","gravatar_id":"","url":"https://api.github.com/users/e-hein","html_url":"https://github.com/e-hein","followers_url":"https://api.github.com/users/e-hein/followers","following_url":"https://api.github.com/users/e-hein/following{/other_user}","gists_url":"https://api.github.com/users/e-hein/gists{/gist_id}","starred_url":"https://api.github.com/users/e-hein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-hein/subscriptions","organizations_url":"https://api.github.com/users/e-hein/orgs","repos_url":"https://api.github.com/users/e-hein/repos","events_url":"https://api.github.com/users/e-hein/events{/privacy}","received_events_url":"https://api.github.com/users/e-hein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/e-hein/angular","description":null,"fork":true,"url":"https://api.github.com/repos/e-hein/angular","forks_url":"https://api.github.com/repos/e-hein/angular/forks","keys_url":"https://api.github.com/repos/e-hein/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/e-hein/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/e-hein/angular/teams","hooks_url":"https://api.github.com/repos/e-hein/angular/hooks","issue_events_url":"https://api.github.com/repos/e-hein/angular/issues/events{/number}","events_url":"https://api.github.com/repos/e-hein/angular/events","assignees_url":"https://api.github.com/repos/e-hein/angular/assignees{/user}","branches_url":"https://api.github.com/repos/e-hein/angular/branches{/branch}","tags_url":"https://api.github.com/repos/e-hein/angular/tags","blobs_url":"https://api.github.com/repos/e-hein/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/e-hein/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/e-hein/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/e-hein/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/e-hein/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/e-hein/angular/languages","stargazers_url":"https://api.github.com/repos/e-hein/angular/stargazers","contributors_url":"https://api.github.com/repos/e-hein/angular/contributors","subscribers_url":"https://api.github.com/repos/e-hein/angular/subscribers","subscription_url":"https://api.github.com/repos/e-hein/angular/subscription","commits_url":"https://api.github.com/repos/e-hein/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/e-hein/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/e-hein/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/e-hein/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/e-hein/angular/contents/{+path}","compare_url":"https://api.github.com/repos/e-hein/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/e-hein/angular/merges","archive_url":"https://api.github.com/repos/e-hein/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/e-hein/angular/downloads","issues_url":"https://api.github.com/repos/e-hein/angular/issues{/number}","pulls_url":"https://api.github.com/repos/e-hein/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/e-hein/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/e-hein/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/e-hein/angular/labels{/name}","releases_url":"https://api.github.com/repos/e-hein/angular/releases{/id}","deployments_url":"https://api.github.com/repos/e-hein/angular/deployments","created_at":"2016-12-28T13:13:44Z","updated_at":"2016-12-28T13:14:06Z","pushed_at":"2016-12-28T22:58:20Z","git_url":"git://github.com/e-hein/angular.git","ssh_url":"git@github.com:e-hein/angular.git","clone_url":"https://github.com/e-hein/angular.git","svn_url":"https://github.com/e-hein/angular","homepage":"https://angular.io","size":35016,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"6b02b80a034491c7f6ebc4eba9ed57140f629856","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":24195339,"name":"angular","full_name":"angular/angular","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular","description":null,"fork":false,"url":"https://api.github.com/repos/angular/angular","forks_url":"https://api.github.com/repos/angular/angular/forks","keys_url":"https://api.github.com/repos/angular/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular/teams","hooks_url":"https://api.github.com/repos/angular/angular/hooks","issue_events_url":"https://api.github.com/repos/angular/angular/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular/events","assignees_url":"https://api.github.com/repos/angular/angular/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular/tags","blobs_url":"https://api.github.com/repos/angular/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular/languages","stargazers_url":"https://api.github.com/repos/angular/angular/stargazers","contributors_url":"https://api.github.com/repos/angular/angular/contributors","subscribers_url":"https://api.github.com/repos/angular/angular/subscribers","subscription_url":"https://api.github.com/repos/angular/angular/subscription","commits_url":"https://api.github.com/repos/angular/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular/merges","archive_url":"https://api.github.com/repos/angular/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular/downloads","issues_url":"https://api.github.com/repos/angular/angular/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular/releases{/id}","deployments_url":"https://api.github.com/repos/angular/angular/deployments","created_at":"2014-09-18T16:12:01Z","updated_at":"2016-12-28T22:34:38Z","pushed_at":"2016-12-28T22:58:22Z","git_url":"git://github.com/angular/angular.git","ssh_url":"git@github.com:angular/angular.git","clone_url":"https://github.com/angular/angular.git","svn_url":"https://github.com/angular/angular","homepage":"https://angular.io","size":35297,"stargazers_count":19297,"watchers_count":19297,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5004,"mirror_url":null,"open_issues_count":958,"forks":5004,"open_issues":958,"watchers":19297,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/13689"},"html":{"href":"https://github.com/angular/angular/pull/13689"},"issue":{"href":"https://api.github.com/repos/angular/angular/issues/13689"},"comments":{"href":"https://api.github.com/repos/angular/angular/issues/13689/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular/pulls/13689/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular/pulls/13689/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular/statuses/65581665d4151c2c2488abbfe8066b2b258a31c1"}}}}
{"actor":{"display_login":"e-hein"}}