{"action":"created","issue":{"url":"https://api.github.com/repos/troyanskiy/ng2-resource-rest/issues/23","repository_url":"https://api.github.com/repos/troyanskiy/ng2-resource-rest","labels_url":"https://api.github.com/repos/troyanskiy/ng2-resource-rest/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/troyanskiy/ng2-resource-rest/issues/23/comments","events_url":"https://api.github.com/repos/troyanskiy/ng2-resource-rest/issues/23/events","html_url":"https://github.com/troyanskiy/ng2-resource-rest/issues/23","id":171621771,"number":23,"title":"Angular RC5 trouble","user":{"login":"anfluff","id":10028578,"avatar_url":"https://avatars.githubusercontent.com/u/10028578?v=3","gravatar_id":"","url":"https://api.github.com/users/anfluff","html_url":"https://github.com/anfluff","followers_url":"https://api.github.com/users/anfluff/followers","following_url":"https://api.github.com/users/anfluff/following{/other_user}","gists_url":"https://api.github.com/users/anfluff/gists{/gist_id}","starred_url":"https://api.github.com/users/anfluff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anfluff/subscriptions","organizations_url":"https://api.github.com/users/anfluff/orgs","repos_url":"https://api.github.com/users/anfluff/repos","events_url":"https://api.github.com/users/anfluff/events{/privacy}","received_events_url":"https://api.github.com/users/anfluff/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/troyanskiy/ng2-resource-rest/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-17T10:12:10Z","updated_at":"2016-09-19T10:57:33Z","closed_at":null,"body":"Hello!\r\nOn RC4 everything works perfect, but now i've just moved to RC5 and got problems.\r\n\r\nI have structure like this:\r\n\r\n```\r\nclient\r\n|-app\r\n    |- +question\r\n        |-question.module.ts\r\n        |-question.component.ts\r\n\r\n|-shared\r\n    |-shared.module.ts\r\n        |-api\r\n            |-resources\r\n            \t|-question.res.ts\r\n|-app.module.ts\r\n```\r\n\r\nI've declared my **QuestionResource** in **SharedModule**: \r\n```\r\nexport class SharedModule {\r\n    static forRoot(): ModuleWithProviders {\r\n        return {\r\n            ngModule: SharedModule,\r\n            providers: [\r\n                QuestionRes\r\n            ]\r\n        };\r\n    }\r\n}\r\n```\r\n\r\nIn **QuestionComponent** i have:\r\n```\r\nngOnInit() {\r\n    this._questionRes.query()\r\n}\r\n```\r\n\r\nAnd when page loads i recieve error:\r\n```\r\nTypeError: Cannot read property 'request' of undefined at eval (http://localhost:5555/node_modules/ng2-resource-rest/index.js:305:44)\r\n```\r\n\r\nAs i understood, angular missing **Http** in **Resource** constructor.\r\nAccording to this i've added to my **QuestionResource** own constructor to pass **Http** to **Resouce** constructor (_just for test_).\r\n```\r\nconstructor(@Inject(Http) protected http: Http) {\r\n        super.constructor(this.http);\r\n    }\r\n```\r\n\r\nAfter this, request loaded as it used to. But i've got another errors in **Resource**...\r\n\r\n---\r\n \r\nHelp me please. Have no opinion what to fix in my code. "},"comment":{"url":"https://api.github.com/repos/troyanskiy/ng2-resource-rest/issues/comments/247963807","html_url":"https://github.com/troyanskiy/ng2-resource-rest/issues/23#issuecomment-247963807","issue_url":"https://api.github.com/repos/troyanskiy/ng2-resource-rest/issues/23","id":247963807,"user":{"login":"anfluff","id":10028578,"avatar_url":"https://avatars.githubusercontent.com/u/10028578?v=3","gravatar_id":"","url":"https://api.github.com/users/anfluff","html_url":"https://github.com/anfluff","followers_url":"https://api.github.com/users/anfluff/followers","following_url":"https://api.github.com/users/anfluff/following{/other_user}","gists_url":"https://api.github.com/users/anfluff/gists{/gist_id}","starred_url":"https://api.github.com/users/anfluff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anfluff/subscriptions","organizations_url":"https://api.github.com/users/anfluff/orgs","repos_url":"https://api.github.com/users/anfluff/repos","events_url":"https://api.github.com/users/anfluff/events{/privacy}","received_events_url":"https://api.github.com/users/anfluff/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T10:57:33Z","updated_at":"2016-09-19T10:57:33Z","body":"Hello!\r\nOnce again i've got a trouble.\r\n(I'm using same app structure as before)\r\n\r\nWhen i moved to ng2-resource-rest 1.2.0 i've added **ResourceModule.forRoot()** to my *AppModule* and removed **ResourceProviders.main()** from  **SharedModule**. Next i changed all my resources to extend from ResourceCRUD.\r\n\r\nNow i receive error about injection:\r\n `Can't resolve all parameters for QuestionComponent: (ActivatedRoute, ?, ErrorService)`\r\n? = QuestionRes.\r\n\r\nShould i register my resources as providers in **SharedModule** somehow?\r\nIf I just list them in providers array, error does not disappear."}}
{"actor":{"display_login":"anfluff"}}