{"action":"closed","issue":{"url":"https://api.github.com/repos/cibernox/ember-power-select/issues/220","labels_url":"https://api.github.com/repos/cibernox/ember-power-select/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/cibernox/ember-power-select/issues/220/comments","events_url":"https://api.github.com/repos/cibernox/ember-power-select/issues/220/events","html_url":"https://github.com/cibernox/ember-power-select/issues/220","id":123193160,"number":220,"title":"contentFor does not require this","user":{"login":"cah-briangantzler","id":1529286,"avatar_url":"https://avatars.githubusercontent.com/u/1529286?v=3","gravatar_id":"","url":"https://api.github.com/users/cah-briangantzler","html_url":"https://github.com/cah-briangantzler","followers_url":"https://api.github.com/users/cah-briangantzler/followers","following_url":"https://api.github.com/users/cah-briangantzler/following{/other_user}","gists_url":"https://api.github.com/users/cah-briangantzler/gists{/gist_id}","starred_url":"https://api.github.com/users/cah-briangantzler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cah-briangantzler/subscriptions","organizations_url":"https://api.github.com/users/cah-briangantzler/orgs","repos_url":"https://api.github.com/users/cah-briangantzler/repos","events_url":"https://api.github.com/users/cah-briangantzler/events{/privacy}","received_events_url":"https://api.github.com/users/cah-briangantzler/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-21T00:49:08Z","updated_at":"2016-01-05T10:29:30Z","closed_at":"2016-01-05T10:29:30Z","body":"This is just an observation I learned when playing. I believe it is correct\r\n\r\nI have a set of components in an addon (private for my company) that I am trying to use ember-power-select. When including my addon in my project I found an error was being thrown (ember-basic-dropdown-wormhole wasnt in the dom) yet this didnt happen my addons dummy app. A lot of research found that ember-power-selects blueprint was not adding ember-basic-dropdown as a package, but instead using the one in ember-power-selects node_modules due to a dependance. Taking that to heart I tried to do the same in my addon and found that doing so ember-power-selects contentFor did not work because the this referred to my addon not ember-power-select. I had to write the following code to work\r\n\r\n```\r\n    contentFor: function(type, config) {\r\n        var emberPowerSelect = this.addons.filter(function(addon) {\r\n            return addon.name === 'ember-power-select';\r\n        })[0];\r\n        return emberPowerSelect.contentFor(type, config);\r\n    }\r\n```\r\n\r\nI am suspecting that the same code would work for ember-power-select. You do not need to call the apply with this. (Looking at ember-basic-dropdown it never uses this which is why it works at this time)\r\n\r\nAlso you will note there is a missing semi-colon after the [0] in the this addon.\r\n\r\nIf I then add ember-power-select to my project to use in other places, I note that ember-basic-dropdown-wormhole <div> gets added twice with the same id (thought that wasnt allowed) but all still works since it uses the first found.\r\n\r\nSo as a question from a learning perspective. Should addons be adding the other addons they depend on to the project with an addPackagesToProject or attempting to use the embedded addon? \r\n\r\nProxying contentFor could lead to the contentFor being called multiple times and quite possibly on different versions of the addon.\r\n\r\n"}}