# Correct way to build components

**URL:** https://meta.discourse.org/t/correct-way-to-build-components/55407
**Category:** Development
**Created:** [2017年一月9日 13:28 UTC](https://meta.discourse.org/t/correct-way-to-build-components/55407 "2017-01-09T13:28:10Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2017年一月10日 17:01 UTC](https://meta.discourse.org/t/correct-way-to-build-components/55407/4 "2017-01-10T17:01:25Z")

</div>

I am far from being even vaguely knowledgable about Ember, but I did have a similar problem to you - a component that needed persistent data unrelated to the page content.

> [@Using Ember Services in Discourse plugins](https://meta.discourse.org/t/using-ember-services-in-discourse-plugins/51713):
>
> I am attempting to make use of Ember “[Services](https://guides.emberjs.com/v1.13.0/understanding-ember/dependency-injection-and-service-lookup/)” in a discourse plugin. Right now I am just trying to get a simple proof of concept working based off of [this tutorial](http://www.programwitherik.com/ember-services-tutorial/) online. Unfortunately I can’t get it working and am not sure if it’s something to do with how plugins are loaded in discourse, or if I’m just doing something wrong. Any help would be appreciated! Right now the plugin is purely clientside, so the plugin.rb just has basic info. # name: Test Plugin # about: A plugin to test Ember ser…

I then used that for my plugin here - the source code might be useful for you:

> [@Discourse Who's Online](https://meta.discourse.org/t/whos-online-plugin/52345):
>
> discourse2Summary Discourse Who’s Online displays a list of users currently active on the sitehammer_and_wrenchRepository Link [https://github.com/discourse/discourse-whos-online](https://github.com/discourse/discourse-whos-online)open_bookInstall Guide [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157)Featuresinformation_source Think carefully before installing this plugin. Discourse is designed for asynchronous discussion, and a list of online users can be harmful for some communities information_source This plugin is b…

---

_[View the full topic](https://meta.discourse.org/t/correct-way-to-build-components/55407)._
