{"action":"created","issue":{"url":"https://api.github.com/repos/angular/di.js/issues/90","labels_url":"https://api.github.com/repos/angular/di.js/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/angular/di.js/issues/90/comments","events_url":"https://api.github.com/repos/angular/di.js/issues/90/events","html_url":"https://github.com/angular/di.js/issues/90","id":52387338,"number":90,"title":"Non-module constructor parameter","user":{"login":"djindjic","id":1564068,"avatar_url":"https://avatars.githubusercontent.com/u/1564068?v=3","gravatar_id":"","url":"https://api.github.com/users/djindjic","html_url":"https://github.com/djindjic","followers_url":"https://api.github.com/users/djindjic/followers","following_url":"https://api.github.com/users/djindjic/following{/other_user}","gists_url":"https://api.github.com/users/djindjic/gists{/gist_id}","starred_url":"https://api.github.com/users/djindjic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djindjic/subscriptions","organizations_url":"https://api.github.com/users/djindjic/orgs","repos_url":"https://api.github.com/users/djindjic/repos","events_url":"https://api.github.com/users/djindjic/events{/privacy}","received_events_url":"https://api.github.com/users/djindjic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-18T16:44:06Z","updated_at":"2015-05-18T21:06:01Z","closed_at":null,"body":"Is possible (and is it relevant question for this repo issues) to have some additional constructor parameter which is not injected module itself? For example coffee_type:\r\n\r\n```js\r\nimport {Inject} from 'di';\r\nimport {Pump} from './pump';\r\n\r\n@Inject(Pump)\r\nexport class CoffeeMaker {\r\n  constructor(pump, coffee_type) {\r\n    this.pump = pump;\r\n    this.coffee_type = coffee_type;\r\n  }\r\n}\r\n\r\nlet injector = new Injector();\r\nlet coffee_maker = injector.get(CoffeeMaker>>>>>('cappuccino')<<<<<<);\r\n```"},"comment":{"url":"https://api.github.com/repos/angular/di.js/issues/comments/103211060","html_url":"https://github.com/angular/di.js/issues/90#issuecomment-103211060","issue_url":"https://api.github.com/repos/angular/di.js/issues/90","id":103211060,"user":{"login":"L8D","id":2355315,"avatar_url":"https://avatars.githubusercontent.com/u/2355315?v=3","gravatar_id":"","url":"https://api.github.com/users/L8D","html_url":"https://github.com/L8D","followers_url":"https://api.github.com/users/L8D/followers","following_url":"https://api.github.com/users/L8D/following{/other_user}","gists_url":"https://api.github.com/users/L8D/gists{/gist_id}","starred_url":"https://api.github.com/users/L8D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L8D/subscriptions","organizations_url":"https://api.github.com/users/L8D/orgs","repos_url":"https://api.github.com/users/L8D/repos","events_url":"https://api.github.com/users/L8D/events{/privacy}","received_events_url":"https://api.github.com/users/L8D/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T21:06:01Z","updated_at":"2015-05-18T21:06:01Z","body":"Though this feature is possible and convenient, the workaround (and possibly better solution) is to supply these extra parameters through provided dependencies. For example:\r\n\r\n```js\r\nimport {Inject, Provide} from 'di';\r\nimport {Pump} from './pump';\r\n\r\nclass CoffeeType {}\r\n\r\n@Inject(Pump, CoffeeType)\r\nexport class CoffeeMaker {\r\n  constructor(pump, coffeeType) {\r\n    this.pump = pump;\r\n    this.coffeeType = coffeeType;\r\n  }\r\n}\r\n\r\n@Provide(CoffeeType)\r\nfunction Cappuccino() {\r\n  return 'cappuccino';\r\n}\r\n\r\nlet injector = new Injector();\r\n\r\nlet withCappucino = injector.createChild([Cappuccino]);\r\nlet coffeeMaker = withCappucino.get(CoffeeMaker);\r\n```"}}