{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/ember.js/issues/4859","labels_url":"https://api.github.com/repos/emberjs/ember.js/issues/4859/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/ember.js/issues/4859/comments","events_url":"https://api.github.com/repos/emberjs/ember.js/issues/4859/events","html_url":"https://github.com/emberjs/ember.js/issues/4859","id":33396592,"number":4859,"title":"No way of binding nested component actions programmatically?","user":{"login":"orochi235","id":2175079,"avatar_url":"https://avatars.githubusercontent.com/u/2175079?v=3","gravatar_id":"","url":"https://api.github.com/users/orochi235","html_url":"https://github.com/orochi235","followers_url":"https://api.github.com/users/orochi235/followers","following_url":"https://api.github.com/users/orochi235/following{/other_user}","gists_url":"https://api.github.com/users/orochi235/gists{/gist_id}","starred_url":"https://api.github.com/users/orochi235/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orochi235/subscriptions","organizations_url":"https://api.github.com/users/orochi235/orgs","repos_url":"https://api.github.com/users/orochi235/repos","events_url":"https://api.github.com/users/orochi235/events{/privacy}","received_events_url":"https://api.github.com/users/orochi235/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/emberjs/ember.js/labels/Needs%20Label%20Review","name":"Needs Label Review","color":"c7def8"},{"url":"https://api.github.com/repos/emberjs/ember.js/labels/Old:%20improvement","name":"Old: improvement","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-05-13T13:17:25Z","updated_at":"2015-03-10T18:17:50Z","closed_at":"2015-03-10T18:17:50Z","body":"Is there a clean/public way to dynamically bind the actions of two nested Ember components in JS? I've spent a fair amount of time digging through docs and Stack Exchange posts, and it seems like there's no way to do this via Ember's public API. Is this an overlooked feature, an architectural constraint, or a deliberate design decision?\r\n\r\nSome background: We've created a number of Ember components that dynamically instantiate each other. For instance, we have two called \"dropdown-list\" and \"choice-list\". When clicked, dropdown-list instantiates and displays a choice-list, and receives an action when an item in the choice-list is selected. \r\n\r\nThis is obviously easy to do in a Handlebars template: you just declare the component and map the child's action to the name of the parent's action handler. But this isn't really an option for us, largely because the child component's DOM structure isn't a subtree of the parent component's DOM tree (it's being displayed in a global modal layer instead).\r\n\r\n__I'm basically looking for a JS equivalent for the second half of this Handlebars declaration:__\r\n\r\n\t{{choice-list userSelect='handleUserSelection'}}\r\n\r\nIf it helps, here's how we're dynamically instantiating child components (from within an action handler on the parent component):\r\n\r\n\tthis.set('list', App.ChoiceListComponent.createWithMixins(App.ModalMixin, {\r\n\t\t/* ... */\r\n\t}));\r\n"},"comment":{"url":"https://api.github.com/repos/emberjs/ember.js/issues/comments/78114587","html_url":"https://github.com/emberjs/ember.js/issues/4859#issuecomment-78114587","issue_url":"https://api.github.com/repos/emberjs/ember.js/issues/4859","id":78114587,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T18:17:50Z","updated_at":"2015-03-10T18:17:50Z","body":"> Foo.create({someAction: 'doSomething'});\r\n\r\npassing these to create is also legit.\r\n\r\nWill reopen, if some other example can be provided that is a pain."}}