# Better way to lookup service in inspector?

**URL:** <https://discuss.emberjs.com/t/better-way-to-lookup-service-in-inspector/16501>\
**Category:** Questions\
**Created:** [April 28, 2019, 1:16pm UTC](https://discuss.emberjs.com/t/better-way-to-lookup-service-in-inspector/16501 "2019-04-28T13:16:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikrothoff](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/erikrothoff/32/11787_2.png) [@erikrothoff](https://discuss.emberjs.com/u/erikrothoff)\
**Post date:** [April 28, 2019, 1:16pm UTC](https://discuss.emberjs.com/t/better-way-to-lookup-service-in-inspector/16501/1 "2019-04-28T13:16:55Z")

</div>

Sometimes in the Web Inspector console I want to quickly lookup instances or controllers etc from the console. I can’t find an easy way to do it. This is the only way I found so far: (…)

```
Frontend._applicationInstances.entries().next().value[0].lookup("service:session")

```

Where: `Frontend` is the name of my app which is exported globally with `ember-export-application-global` and in this example I’m looking up the service called `session`.

There’s has to be a better way??

---

<div class="post-metadata">

**Author:** ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)\
**Post date:** [April 28, 2019, 2:22pm UTC](https://discuss.emberjs.com/t/better-way-to-lookup-service-in-inspector/16501/2 "2019-04-28T14:22:51Z")

</div>

I’d probably remove ember-application-export-global and make your own instance initializer that sets `self.Frontend = instance;`.

Once you do that, looking up services ends up being:

```nohighlight
Frontend.lookup(‘service:some-name’)

```

---

<div class="post-metadata">

**Author:** ![erikrothoff](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/erikrothoff/32/11787_2.png) [@erikrothoff](https://discuss.emberjs.com/u/erikrothoff)\
**Post date:** [April 29, 2019, 7:47am UTC](https://discuss.emberjs.com/t/better-way-to-lookup-service-in-inspector/16501/3 "2019-04-29T07:47:45Z")

</div>

Interesting and simple fix. Curious though, what is the use-case for `ember-application-export-global`? I don’t fully grok what the `Application` class does compared to `ApplicationInstance`…

---

<div class="post-metadata">

**Author:** ![dknutsen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/dknutsen/32/16471_2.png) [@dknutsen](https://discuss.emberjs.com/u/dknutsen)\
**Post date:** [April 29, 2019, 1:57pm UTC](https://discuss.emberjs.com/t/better-way-to-lookup-service-in-inspector/16501/4 "2019-04-29T13:57:56Z")

</div>

There’s a nice little [section in the Ember Guides](https://guides.emberjs.com/release/applications/applications-and-instances/) about that if you haven’t seen it yet.

---

<div class="post-metadata">

**Author:** ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)\
**Post date:** [April 29, 2019, 2:06pm UTC](https://discuss.emberjs.com/t/better-way-to-lookup-service-in-inspector/16501/5 "2019-04-29T14:06:04Z")

</div>

ember-application-export-global was created before the concept of `ApplicationInstance`s (and before the advent of a public API for accessing instantiated singletons).

Likely we could update it to the solution I linked (tied with a major version bump)…
