{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular/issues/2223","labels_url":"https://api.github.com/repos/angular/angular/issues/2223/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/2223/comments","events_url":"https://api.github.com/repos/angular/angular/issues/2223/events","html_url":"https://github.com/angular/angular/issues/2223","id":82579538,"number":2223,"title":"Dependency Injection when referencing Interface","user":{"login":"mfrancis107","id":1110680,"avatar_url":"https://avatars.githubusercontent.com/u/1110680?v=3","gravatar_id":"","url":"https://api.github.com/users/mfrancis107","html_url":"https://github.com/mfrancis107","followers_url":"https://api.github.com/users/mfrancis107/followers","following_url":"https://api.github.com/users/mfrancis107/following{/other_user}","gists_url":"https://api.github.com/users/mfrancis107/gists{/gist_id}","starred_url":"https://api.github.com/users/mfrancis107/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfrancis107/subscriptions","organizations_url":"https://api.github.com/users/mfrancis107/orgs","repos_url":"https://api.github.com/users/mfrancis107/repos","events_url":"https://api.github.com/users/mfrancis107/events{/privacy}","received_events_url":"https://api.github.com/users/mfrancis107/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-29T20:42:28Z","updated_at":"2015-05-29T20:42:28Z","closed_at":null,"body":"This conversation could probably be in the Typescript area also.\r\n\r\n```javascript\r\n///<reference path=\"../../../typings/angular2/angular2\" />\r\nimport {Component, ElementRef, View} from 'angular2/angular2';\r\nimport {Inject} from 'angular2/di';\r\n@Component({\r\n    selector: 'welcome-section',\r\n})\r\n@View({\r\n    template: `\r\n            <div class=\"bg-primary header\">\r\n                <div class=\"card-container\"><h1 style=\"color:#ECEFF1;\">Let's Design Your App!</h1></div>\r\n            </div>\r\n        `\r\n})\r\nexport class WelcomeSection{\r\n\r\n    constructor(elRef: ElementRef){\r\n        console.log(elRef);\r\n    }\r\n\r\n}\r\n```\r\n\r\nIf in the type file ElementRef is declared as an Interface the compiled output is not correct.\r\n\r\n```javascript\r\n///<reference path=\"../../../typings/angular2/angular2\" />\r\nvar angular2_1 = require('angular2/angular2');\r\nvar WelcomeSection = (function () {\r\n    function WelcomeSection(elRef) {\r\n        console.log(elRef);\r\n    }\r\n    WelcomeSection = __decorate([\r\n        angular2_1.Component({\r\n            selector: 'welcome-section',\r\n        }),\r\n        angular2_1.View({\r\n            template: \"\\n            <div class=\\\"bg-primary header\\\">\\n                <div class=\\\"card-container\\\"><h1 style=\\\"color:#ECEFF1;\\\">Let's Design Your App!</h1></div>\\n            </div>\\n        \"\r\n        }), \r\n        __metadata('design:paramtypes', [Object])\r\n    ], WelcomeSection);\r\n    return WelcomeSection;\r\n})();\r\nexports.WelcomeSection = WelcomeSection;\r\n```\r\n\r\nWhere it should have\r\n```javascript\r\n__metadata('design:paramtypes', [angular2_1.ElementRef])\r\n```\r\n\r\nThe reason I bring this up here is because I'm not sure that Typescript is doing anything wrong. But this seems like it would cause serious problems when trying to use third party library and dependency injection as most people don't include classes in their type declarations.\r\n\r\nDoes the angular team have a best practice to over come this?"}}