# Using Ember Services in Discourse plugins

**URL:** <https://meta.discourse.org/t/using-ember-services-in-discourse-plugins/51713>\
**Category:** Development\
**Created:** [October 18, 2016, 9:42pm UTC](https://meta.discourse.org/t/using-ember-services-in-discourse-plugins/51713 "2016-10-18T21:42:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [October 19, 2016, 4:22pm UTC](https://meta.discourse.org/t/using-ember-services-in-discourse-plugins/51713/4 "2016-10-19T16:22:42Z")

</div>

I think the approach you are taking is correct in that case. I can suggest another way to do a singleton but maybe we should try and get this working the ember way?

Actually I looked and we do have a few ember services already! They’re just not used via `Ember.inject`. The problem is probably that the resolver we use doesn’t resolve them.

I suspect if you add a `resolveService` method to [the custom resolver](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse-common/resolver.js.es6#L103) it might work!

If not, maybe add some debugging to see what `Ember.inject` is looking up?

---

_[View the full topic](https://meta.discourse.org/t/using-ember-services-in-discourse-plugins/51713)._
