{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/15536","repository_url":"https://api.github.com/repos/angular/angular.js","labels_url":"https://api.github.com/repos/angular/angular.js/issues/15536/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/15536/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/15536/events","html_url":"https://github.com/angular/angular.js/issues/15536","id":196960121,"number":15536,"title":"$inject with ES6 classes can inject the wrong dependencies","user":{"login":"ChrisMondok","id":779770,"avatar_url":"https://avatars.githubusercontent.com/u/779770?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisMondok","html_url":"https://github.com/ChrisMondok","followers_url":"https://api.github.com/users/ChrisMondok/followers","following_url":"https://api.github.com/users/ChrisMondok/following{/other_user}","gists_url":"https://api.github.com/users/ChrisMondok/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisMondok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisMondok/subscriptions","organizations_url":"https://api.github.com/users/ChrisMondok/orgs","repos_url":"https://api.github.com/users/ChrisMondok/repos","events_url":"https://api.github.com/users/ChrisMondok/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisMondok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-12-21T15:27:55Z","updated_at":"2016-12-22T16:11:56Z","closed_at":null,"body":"***Note*: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.**\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n\r\nBug\r\n\r\n**What is the current behavior?**\r\n\r\nWhen angular annotates a base class, it uses the inherited annotations when resolving the dependencies of derived classes.\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).**\r\n\r\nhttp://plnkr.co/edit/55dt9Xx8z5qvHZQ9eDdQ?p=preview\r\n\r\n**What is the expected behavior?**\r\n\r\nDerived classes should not inherit their parent's $inject property, as they do not necessarily share dependencies.\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\n\r\nThis behavior introduces a potentially hard to debug issue, and is probably not what the user expects to happen.\r\n\r\n**Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.**\r\n\r\nThis is still an issue when running against the snapshot as of 2016-12-21\r\n\r\n**Other information (e.g. stacktraces, related issues, suggestions how to fix)**"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/268832360","html_url":"https://github.com/angular/angular.js/issues/15536#issuecomment-268832360","issue_url":"https://api.github.com/repos/angular/angular.js/issues/15536","id":268832360,"user":{"login":"mgol","id":1758366,"avatar_url":"https://avatars.githubusercontent.com/u/1758366?v=3","gravatar_id":"","url":"https://api.github.com/users/mgol","html_url":"https://github.com/mgol","followers_url":"https://api.github.com/users/mgol/followers","following_url":"https://api.github.com/users/mgol/following{/other_user}","gists_url":"https://api.github.com/users/mgol/gists{/gist_id}","starred_url":"https://api.github.com/users/mgol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgol/subscriptions","organizations_url":"https://api.github.com/users/mgol/orgs","repos_url":"https://api.github.com/users/mgol/repos","events_url":"https://api.github.com/users/mgol/events{/privacy}","received_events_url":"https://api.github.com/users/mgol/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T16:11:56Z","updated_at":"2016-12-22T16:11:56Z","body":"We've diverged a little from the original issue. Going back there, I'd like whatever constructor-detecting heuristic to be used only outside of the `strictDi` mode as one of the `strictDi` purposes is to get rid of magic in favor of predictable behavior (and we recommend to enforce `strictDi` in development mode). We should aim at eliminating all function/class stringification to find something (we *have* added a new stringification recently - the class-detecting one - but it should be gone when we drop support for turning the `preAssingBindingsEnabled` flag back to `true`) as it's too prone to error.\r\n\r\nBecause of that, I agree with @gkalpak's [comment](https://github.com/angular/angular.js/issues/15536#issuecomment-268665044) that there is no reliable way to detect constructor-less classes and that we should keep current implementation."}}
{"actor":{"display_login":"mgol"}}