# Using a Discourse component in a plugin

**URL:** <https://meta.discourse.org/t/using-a-discourse-component-in-a-plugin/56155>\
**Category:** Development\
**Created:** [22 يناير 2017، 7:33ص UTC](https://meta.discourse.org/t/using-a-discourse-component-in-a-plugin/56155 "2017-01-22T07:33:38Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jgujgu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jgujgu/32/64012_2.png) [@jgujgu](https://meta.discourse.org/u/jgujgu)\
**Post date:** [22 يناير 2017، 7:33ص UTC](https://meta.discourse.org/t/using-a-discourse-component-in-a-plugin/56155/1 "2017-01-22T07:33:38Z")

</div>

I have a question about reusing Discourse “core” Ember components in plugins. More particularly, I ran into trouble today trying to put a “signup” d-button into a plugin template.

Here is where I tried to do:

> <https://github.com/jgujgu/discourse-call-to-action/blob/master/assets/javascripts/discourse/templates/connectors/discovery-below/call-to-action.hbs#L14>

And this is the console error it created:

 ![](https://global.discourse-cdn.com/meta/original/3X/2/0/20c435932ef839944c06aa75233f3d6b62ea9564.png)

I understand (very vaguely?) that showCreateAccount is a controller function passed along to different components that need it:

> <https://github.com/discourse/discourse/blob/adb73180f727be5b5bf4772c81f99e5ac9d10eea/app/assets/javascripts/discourse/templates/application.hbs#L3>

Moreover, in order to get this modal to pop up in my component, do I need to fundamentally change the structure of my files? I don’t think my file structure is necessarily correct either. 😓

---

_[View the full topic](https://meta.discourse.org/t/using-a-discourse-component-in-a-plugin/56155)._
