{"action":"closed","issue":{"url":"https://api.github.com/repos/aurelia/aurelia/issues/218","repository_url":"https://api.github.com/repos/aurelia/aurelia","labels_url":"https://api.github.com/repos/aurelia/aurelia/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/aurelia/issues/218/comments","events_url":"https://api.github.com/repos/aurelia/aurelia/issues/218/events","html_url":"https://github.com/aurelia/aurelia/issues/218","id":368801179,"node_id":"MDU6SXNzdWUzNjg4MDExNzk=","number":218,"title":"Context traversal not working inside custom elements","user":{"login":"fkleuver","id":9655331,"node_id":"MDQ6VXNlcjk2NTUzMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/9655331?v=4","gravatar_id":"","url":"https://api.github.com/users/fkleuver","html_url":"https://github.com/fkleuver","followers_url":"https://api.github.com/users/fkleuver/followers","following_url":"https://api.github.com/users/fkleuver/following{/other_user}","gists_url":"https://api.github.com/users/fkleuver/gists{/gist_id}","starred_url":"https://api.github.com/users/fkleuver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fkleuver/subscriptions","organizations_url":"https://api.github.com/users/fkleuver/orgs","repos_url":"https://api.github.com/users/fkleuver/repos","events_url":"https://api.github.com/users/fkleuver/events{/privacy}","received_events_url":"https://api.github.com/users/fkleuver/received_events","type":"User","site_admin":false},"labels":[{"id":837865686,"node_id":"MDU6TGFiZWw4Mzc4NjU2ODY=","url":"https://api.github.com/repos/aurelia/aurelia/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"closed","locked":false,"assignee":{"login":"EisenbergEffect","id":131485,"node_id":"MDQ6VXNlcjEzMTQ4NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/131485?v=4","gravatar_id":"","url":"https://api.github.com/users/EisenbergEffect","html_url":"https://github.com/EisenbergEffect","followers_url":"https://api.github.com/users/EisenbergEffect/followers","following_url":"https://api.github.com/users/EisenbergEffect/following{/other_user}","gists_url":"https://api.github.com/users/EisenbergEffect/gists{/gist_id}","starred_url":"https://api.github.com/users/EisenbergEffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EisenbergEffect/subscriptions","organizations_url":"https://api.github.com/users/EisenbergEffect/orgs","repos_url":"https://api.github.com/users/EisenbergEffect/repos","events_url":"https://api.github.com/users/EisenbergEffect/events{/privacy}","received_events_url":"https://api.github.com/users/EisenbergEffect/received_events","type":"User","site_admin":false},"assignees":[{"login":"EisenbergEffect","id":131485,"node_id":"MDQ6VXNlcjEzMTQ4NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/131485?v=4","gravatar_id":"","url":"https://api.github.com/users/EisenbergEffect","html_url":"https://github.com/EisenbergEffect","followers_url":"https://api.github.com/users/EisenbergEffect/followers","following_url":"https://api.github.com/users/EisenbergEffect/following{/other_user}","gists_url":"https://api.github.com/users/EisenbergEffect/gists{/gist_id}","starred_url":"https://api.github.com/users/EisenbergEffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EisenbergEffect/subscriptions","organizations_url":"https://api.github.com/users/EisenbergEffect/orgs","repos_url":"https://api.github.com/users/EisenbergEffect/repos","events_url":"https://api.github.com/users/EisenbergEffect/events{/privacy}","received_events_url":"https://api.github.com/users/EisenbergEffect/received_events","type":"User","site_admin":false},{"login":"fkleuver","id":9655331,"node_id":"MDQ6VXNlcjk2NTUzMzE=","avatar_url":"https://avatars1.githubusercontent.com/u/9655331?v=4","gravatar_id":"","url":"https://api.github.com/users/fkleuver","html_url":"https://github.com/fkleuver","followers_url":"https://api.github.com/users/fkleuver/followers","following_url":"https://api.github.com/users/fkleuver/following{/other_user}","gists_url":"https://api.github.com/users/fkleuver/gists{/gist_id}","starred_url":"https://api.github.com/users/fkleuver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fkleuver/subscriptions","organizations_url":"https://api.github.com/users/fkleuver/orgs","repos_url":"https://api.github.com/users/fkleuver/repos","events_url":"https://api.github.com/users/fkleuver/events{/privacy}","received_events_url":"https://api.github.com/users/fkleuver/received_events","type":"User","site_admin":false},{"login":"bigopon","id":9994529,"node_id":"MDQ6VXNlcjk5OTQ1Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/9994529?v=4","gravatar_id":"","url":"https://api.github.com/users/bigopon","html_url":"https://github.com/bigopon","followers_url":"https://api.github.com/users/bigopon/followers","following_url":"https://api.github.com/users/bigopon/following{/other_user}","gists_url":"https://api.github.com/users/bigopon/gists{/gist_id}","starred_url":"https://api.github.com/users/bigopon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigopon/subscriptions","organizations_url":"https://api.github.com/users/bigopon/orgs","repos_url":"https://api.github.com/users/bigopon/repos","events_url":"https://api.github.com/users/bigopon/events{/privacy}","received_events_url":"https://api.github.com/users/bigopon/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-10-10T18:46:14Z","updated_at":"2018-10-11T22:52:06Z","closed_at":"2018-10-11T22:52:05Z","author_association":"MEMBER","body":"<!---\r\nThanks for filing an issue 😄 ! Before you submit, please read the following:\r\n\r\nSearch open/closed issues before submitting since someone might have asked the same thing before!\r\n-->\r\n\r\n# 🐛 Bug Report\r\n\r\nA custom element does not have access to `$parent` via the `parentOverrideContext`, at least not when there's a repeater / template controller on it.\r\n\r\n## 🤔 Expected Behavior\r\n\r\n`@customElement`'s `$hydrate` should create its scope based on the parentScope so that the bindingContext inside it can traverse upwards\r\n\r\n## 😯 Current Behavior\r\n\r\nIt does this: `this.$scope = BindingContext.createScope(this);` (line 148, custom-element.ts)\r\n\r\nConsequently, `@customElement` has no access to parent context\r\n\r\n## 💁 Possible Solution\r\n\r\nThe `$scope` somehow needs to be passed down from parent to child during hydration because currently there seems to be no direct way to access it.\r\n\r\nWe could either directly register/store it via the `renderingEngine` or `renderContext`, or somehow let child resources access their parents and get the parent scope that way. I'm hesitant on either approach.\r\n\r\nWe could also make the scope a first-class citizen during the rendering process, as an extra argument in addition to `renderable` / `target` / `instruction`. It doesn't necessarily seem wrong to be because the scope is the same level of granularity of the `target`, which the renderer also explicitly passes around.\r\n\r\nI have not looked at or considered how vCurrent solves this. These are just my initial thoughts.\r\n\r\n\r\nI can also be completely and utterly wrong and this could be an issue with how the template compiler processes bindable attributes on custom elements after wrapping them. I haven't debugged it yet.\r\n\r\n## 🔦 Context\r\n\r\nTemplate controllers will wrap custom elements in a new context and thereby they lose access to the properties they're bound to, meaning nothing will work with a repeater+custom element unless all the bindable properties come first.\r\n\r\n## 💻 Code Sample\r\n\r\nSee this [integration test](https://github.com/aurelia/aurelia/pull/217/files#diff-76aa27f7a7be71f350f6b7644b522cc3R636)\r\n\r\n## 🌍 Your Environment\r\n\r\nN/A\r\n\r\n<!-- Love Aurelia? Please consider supporting our collective:\r\n👉  https://opencollective.com/aurelia -->\r\n"}}
{"actor":{"display_login":"fkleuver"}}