{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/dependency-injection/issues/153","repository_url":"https://api.github.com/repos/aurelia/dependency-injection","labels_url":"https://api.github.com/repos/aurelia/dependency-injection/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/dependency-injection/issues/153/comments","events_url":"https://api.github.com/repos/aurelia/dependency-injection/issues/153/events","html_url":"https://github.com/aurelia/dependency-injection/issues/153","id":251945560,"number":153,"title":"@lazy not working with @autoinject","user":{"login":"gronostajo","id":1347866,"avatar_url":"https://avatars3.githubusercontent.com/u/1347866?v=4","gravatar_id":"","url":"https://api.github.com/users/gronostajo","html_url":"https://github.com/gronostajo","followers_url":"https://api.github.com/users/gronostajo/followers","following_url":"https://api.github.com/users/gronostajo/following{/other_user}","gists_url":"https://api.github.com/users/gronostajo/gists{/gist_id}","starred_url":"https://api.github.com/users/gronostajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gronostajo/subscriptions","organizations_url":"https://api.github.com/users/gronostajo/orgs","repos_url":"https://api.github.com/users/gronostajo/repos","events_url":"https://api.github.com/users/gronostajo/events{/privacy}","received_events_url":"https://api.github.com/users/gronostajo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-08-22T12:50:06Z","updated_at":"2018-04-29T18:14:59Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nBUGS: Please use this template.\r\n\r\nSUPPORT REQUESTS/QUESTIONS: If you have a support request or question please\r\nsubmit them to StackOverflow using the tags aurelia and aurelia-framework\r\nhttp://stackoverflow.com/questions/tagged/aurelia\r\nor the Aurelia Gitter https://gitter.im/aurelia/discuss\r\n\r\nBlue Spire offers paid support agreements. Further information regarding paid support\r\nmay be obtained by emailing support@bluespire.com\r\n\r\nFuture support requests submitted here will be closed.\r\n\r\nThe HTML comments below are for your reference, and are not displayed\r\nwhen your issue is submitted, feel free to leave them.\r\n\r\nChoose one of the two headings, delete the other.\r\n-->\r\n**I'm submitting a bug report**\r\n\r\n* **Library Version:**\r\n1.3.2\r\n\r\n\r\n**Please tell us about your environment:**\r\n* **Operating System:**\r\nWindows 10\r\n\r\n* **Node Version:**\r\n6.11.2\r\n<!--\r\nMinimum supported Node version is latest Node 4.x LTS\r\nrun `node -v`\r\n-->\r\n\r\n* **NPM Version:**\r\n4.6.1\r\n<!--\r\nMinimum supported NPM version is 3.x\r\nrun `npm -v`\r\n-->\r\n\r\n* **JSPM OR Webpack AND Version**\r\nJSPM 0.16.48 (reproduced with Aurelia CLI v0.31.1)\r\n<!--\r\nIf using JSPM\r\nrun `jspm -v`\r\nIf using Webpack\r\nrun `webpack --help | grep webpack`\r\n-->\r\n\r\n* **Browser:**\r\nall\r\n\r\n* **Language:**\r\nTypeScript 2.4.2\r\n\r\n\r\n**Current behavior:**\r\nConstructor arguments decorated with `@lazy` are injected with `undefined` when class is `@autoinject`ed. [Code](https://github.com/gronostajo/aurelia-dependency-injection-lazy-bug), [live demo](https://gronostajo.github.io/aurelia-dependency-injection-lazy-bug/).\r\n\r\n**Expected/desired behavior:**\r\n<!--\r\nIf the current behavior is a bug, please provide the steps to reproduce and, if possible, a minimal demo of the\r\nproblem along with a runnable gist, if possible.\r\nTo create a runnable gist, go to https://gist.run/?id=7542e061bc940cde506b&sha=6821c521a6c7bae6f59a36fb8628ecd1032b2d10\r\nThen click \"Fork to Public Gist\".\r\nCreate your gist, then finally click \"Update Gist.\" Include a link to the gist.run below.\r\n-->\r\n\r\n\r\n* **What is the expected behavior?**\r\n`@autoinject` and `@lazy` should work well together. It probably was after #111 was merged.\r\n\r\n* **What is the motivation / use case for changing the behavior?**\r\nI want to be able to do this:\r\n\r\n```\r\n@autoinject\r\nexport class Alert {\r\n  constructor(private i18n: I18N, @lazy(TemplatingEngine) private templatingEngine: () => TemplatingEngine) {\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/aurelia/dependency-injection/issues/comments/385270363","html_url":"https://github.com/aurelia/dependency-injection/issues/153#issuecomment-385270363","issue_url":"https://api.github.com/repos/aurelia/dependency-injection/issues/153","id":385270363,"user":{"login":"doktordirk","id":13430091,"avatar_url":"https://avatars1.githubusercontent.com/u/13430091?v=4","gravatar_id":"","url":"https://api.github.com/users/doktordirk","html_url":"https://github.com/doktordirk","followers_url":"https://api.github.com/users/doktordirk/followers","following_url":"https://api.github.com/users/doktordirk/following{/other_user}","gists_url":"https://api.github.com/users/doktordirk/gists{/gist_id}","starred_url":"https://api.github.com/users/doktordirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doktordirk/subscriptions","organizations_url":"https://api.github.com/users/doktordirk/orgs","repos_url":"https://api.github.com/users/doktordirk/repos","events_url":"https://api.github.com/users/doktordirk/events{/privacy}","received_events_url":"https://api.github.com/users/doktordirk/received_events","type":"User","site_admin":false},"created_at":"2018-04-29T18:14:59Z","updated_at":"2018-04-29T18:14:59Z","author_association":"NONE","body":"@EisenbergEffect as such sure, but that was a hack. \r\ni did dig further and found that this bug was introduced when fixing that issue #121 in pr #129.\r\n\r\nmy guess is that it got overboard there, and there wasn't anything else wrong other that the loop. it seems that they thought that the previousInject mentioned there was coming from a super class. instead it is (at least also) coming from the now bugged @lazy decorator which adds the inject property before @autoinject is called. \r\n\r\nwould have been easier if PR+129  had included some tests for the presumed inheritance issue (resp @lazy would have had better tests). i might write some myself to see what happens"}}
{"actor":{"display_login":"doktordirk"}}