{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/15521","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/15521/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/15521/comments","events_url":"https://api.github.com/repos/angular/angular/issues/15521/events","html_url":"https://github.com/angular/angular/issues/15521","id":217271309,"number":15521,"title":"Angular 4 fails to provide MockBackend","user":{"login":"halamah","id":15220172,"avatar_url":"https://avatars1.githubusercontent.com/u/15220172?v=3","gravatar_id":"","url":"https://api.github.com/users/halamah","html_url":"https://github.com/halamah","followers_url":"https://api.github.com/users/halamah/followers","following_url":"https://api.github.com/users/halamah/following{/other_user}","gists_url":"https://api.github.com/users/halamah/gists{/gist_id}","starred_url":"https://api.github.com/users/halamah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halamah/subscriptions","organizations_url":"https://api.github.com/users/halamah/orgs","repos_url":"https://api.github.com/users/halamah/repos","events_url":"https://api.github.com/users/halamah/events{/privacy}","received_events_url":"https://api.github.com/users/halamah/received_events","type":"User","site_admin":false},"labels":[{"id":279828207,"url":"https://api.github.com/repos/angular/angular/labels/comp:%20http","name":"comp: http","color":"c7def8","default":false},{"id":375498262,"url":"https://api.github.com/repos/angular/angular/labels/severity5:%20regression","name":"severity5: regression","color":"0052cc","default":false},{"id":130606843,"url":"https://api.github.com/repos/angular/angular/labels/type:%20bug","name":"type: bug","color":"EEEEEE","default":false}],"state":"open","locked":false,"assignee":{"login":"alxhub","id":4175141,"avatar_url":"https://avatars3.githubusercontent.com/u/4175141?v=3","gravatar_id":"","url":"https://api.github.com/users/alxhub","html_url":"https://github.com/alxhub","followers_url":"https://api.github.com/users/alxhub/followers","following_url":"https://api.github.com/users/alxhub/following{/other_user}","gists_url":"https://api.github.com/users/alxhub/gists{/gist_id}","starred_url":"https://api.github.com/users/alxhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alxhub/subscriptions","organizations_url":"https://api.github.com/users/alxhub/orgs","repos_url":"https://api.github.com/users/alxhub/repos","events_url":"https://api.github.com/users/alxhub/events{/privacy}","received_events_url":"https://api.github.com/users/alxhub/received_events","type":"User","site_admin":false},"assignees":[{"login":"alxhub","id":4175141,"avatar_url":"https://avatars3.githubusercontent.com/u/4175141?v=3","gravatar_id":"","url":"https://api.github.com/users/alxhub","html_url":"https://github.com/alxhub","followers_url":"https://api.github.com/users/alxhub/followers","following_url":"https://api.github.com/users/alxhub/following{/other_user}","gists_url":"https://api.github.com/users/alxhub/gists{/gist_id}","starred_url":"https://api.github.com/users/alxhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alxhub/subscriptions","organizations_url":"https://api.github.com/users/alxhub/orgs","repos_url":"https://api.github.com/users/alxhub/repos","events_url":"https://api.github.com/users/alxhub/events{/privacy}","received_events_url":"https://api.github.com/users/alxhub/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2017-03-27T14:49:23Z","updated_at":"2017-04-05T18:55:26Z","closed_at":null,"body":"<!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\r\n-->\r\n\r\n**I'm submitting a ...**  (check one with \"x\")\r\n```\r\n[x] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\n<!-- Describe how the bug manifests. -->\r\n\r\nException if adding MockBackend to a list of AppModule providers: \r\n\r\n**\"Uncaught Error: Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using 'barrel' index.ts files.\"**\r\n\r\nThis behavior since Angular 4.0 RC4/5. Mocking this way in 4.0 RC3 and earlier working just fine.\r\n\r\nException in CompileMetadataResolver.prototype._getProvidersMetadata function\r\n...\r\nelse if (provider === void 0) {\r\n    _this._reportError(syntaxError(\"Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using 'barrel' index.ts files.\"));\r\n}\r\n...\r\n\r\n**Expected behavior**\r\n<!-- Describe what the behavior would be without the bug. -->\r\n\r\nFakeProvider is instantiated and MockBackend instance successfully injected.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\n\r\nAdd MockBackend to a list of AppModule providers.\r\n...\r\nimport {MockBackend} from \"@angular/http/testing\";\r\n...\r\nproviders: [\r\n        ...\r\n       MockBackend, // <--\r\n        //FakeProvider,\r\n        //BaseRequestOptions\r\n],\r\n...\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\n<!-- Describe the motivation or the concrete use case -->\r\n\r\nMock an Http service for testing purpose and backend-less development\r\n\r\n**Please tell us about your environment:**\r\n<!-- Operating system, IDE, package manager, HTTP server, ... -->\r\n\r\n* **Angular version:** 4.0.0\r\n<!-- Check whether this is still an issue in the most recent Angular version -->\r\n\r\n* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]\r\n<!-- All browsers where this could be reproduced -->\r\n \r\n* **Language:** Typescript 2.2\r\n\r\n* **Node (for AoT issues):** `node --version` =  6.6.0\r\n\r\n*     webpack: \"^2.3.2\", webpack-dev-server: \"^2.4.2\", webpack-merge: \"^4.1.0\"\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/291960864","html_url":"https://github.com/angular/angular/issues/15521#issuecomment-291960864","issue_url":"https://api.github.com/repos/angular/angular/issues/15521","id":291960864,"user":{"login":"vascofernandes","id":10337953,"avatar_url":"https://avatars3.githubusercontent.com/u/10337953?v=3","gravatar_id":"","url":"https://api.github.com/users/vascofernandes","html_url":"https://github.com/vascofernandes","followers_url":"https://api.github.com/users/vascofernandes/followers","following_url":"https://api.github.com/users/vascofernandes/following{/other_user}","gists_url":"https://api.github.com/users/vascofernandes/gists{/gist_id}","starred_url":"https://api.github.com/users/vascofernandes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vascofernandes/subscriptions","organizations_url":"https://api.github.com/users/vascofernandes/orgs","repos_url":"https://api.github.com/users/vascofernandes/repos","events_url":"https://api.github.com/users/vascofernandes/events{/privacy}","received_events_url":"https://api.github.com/users/vascofernandes/received_events","type":"User","site_admin":false},"created_at":"2017-04-05T18:55:26Z","updated_at":"2017-04-05T18:55:26Z","body":"same problem, MockBackend not available in aot.\r\n\r\n"}}
{"actor":{"display_login":"vascofernandes"}}