{"action":"created","issue":{"url":"https://api.github.com/repos/inversify/InversifyJS/issues/809","repository_url":"https://api.github.com/repos/inversify/InversifyJS","labels_url":"https://api.github.com/repos/inversify/InversifyJS/issues/809/labels{/name}","comments_url":"https://api.github.com/repos/inversify/InversifyJS/issues/809/comments","events_url":"https://api.github.com/repos/inversify/InversifyJS/issues/809/events","html_url":"https://github.com/inversify/InversifyJS/issues/809","id":302098316,"number":809,"title":"How can I resolve dependency with the Initialization parameters which will be constructor‘s parameters ?","user":{"login":"JerryYu2014","id":9960892,"avatar_url":"https://avatars1.githubusercontent.com/u/9960892?v=4","gravatar_id":"","url":"https://api.github.com/users/JerryYu2014","html_url":"https://github.com/JerryYu2014","followers_url":"https://api.github.com/users/JerryYu2014/followers","following_url":"https://api.github.com/users/JerryYu2014/following{/other_user}","gists_url":"https://api.github.com/users/JerryYu2014/gists{/gist_id}","starred_url":"https://api.github.com/users/JerryYu2014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JerryYu2014/subscriptions","organizations_url":"https://api.github.com/users/JerryYu2014/orgs","repos_url":"https://api.github.com/users/JerryYu2014/repos","events_url":"https://api.github.com/users/JerryYu2014/events{/privacy}","received_events_url":"https://api.github.com/users/JerryYu2014/received_events","type":"User","site_admin":false},"labels":[{"id":196905384,"url":"https://api.github.com/repos/inversify/InversifyJS/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-04T16:15:48Z","updated_at":"2018-03-19T23:59:55Z","closed_at":null,"author_association":"NONE","body":"I want to resolve dependency with the Initialization parameters which will be the constructor‘s parameters .\r\n\r\n## Expected Behavior\r\nresolve dependency with the Initialization parameters which will be constructor‘ parameters\r\n\r\n## Current Behavior\r\nI can't find the solution about how to afferent the initialization parameters after I have look up the documents  and issues on this project.\r\n"},"comment":{"url":"https://api.github.com/repos/inversify/InversifyJS/issues/comments/374426091","html_url":"https://github.com/inversify/InversifyJS/issues/809#issuecomment-374426091","issue_url":"https://api.github.com/repos/inversify/InversifyJS/issues/809","id":374426091,"user":{"login":"zach-10e","id":35114664,"avatar_url":"https://avatars2.githubusercontent.com/u/35114664?v=4","gravatar_id":"","url":"https://api.github.com/users/zach-10e","html_url":"https://github.com/zach-10e","followers_url":"https://api.github.com/users/zach-10e/followers","following_url":"https://api.github.com/users/zach-10e/following{/other_user}","gists_url":"https://api.github.com/users/zach-10e/gists{/gist_id}","starred_url":"https://api.github.com/users/zach-10e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zach-10e/subscriptions","organizations_url":"https://api.github.com/users/zach-10e/orgs","repos_url":"https://api.github.com/users/zach-10e/repos","events_url":"https://api.github.com/users/zach-10e/events{/privacy}","received_events_url":"https://api.github.com/users/zach-10e/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T23:59:55Z","updated_at":"2018-03-19T23:59:55Z","author_association":"NONE","body":"You'd probably want to bind the initialization parameters to a [constant or dynamic value](https://github.com/inversify/InversifyJS/blob/master/wiki/value_injection.md) and let the container inject them into the constructor for you.\r\n\r\n```typescript\r\n// inversify.config.ts\r\nconst container = new Container();\r\ncontainer.bind<ILogger>(LoggerType.Logger).to(Log4jImp);\r\ncontainer.bind('LoggerCategory').to('myCategory');\r\n```\r\n```typescript\r\n@injectable()\r\nclass Log4jImp implements ILogger {\r\n    constructor(@inject('LoggerCategory') category: string) {\r\n        // ...\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"zach-10e"}}