# Is there an update on how to inject into custom Object classes?

**URL:** https://discuss.emberjs.com/t/is-there-an-update-on-how-to-inject-into-custom-object-classes/6063
**Category:** Uncategorized
**Created:** [August 12, 2014, 12:54pm UTC](https://discuss.emberjs.com/t/is-there-an-update-on-how-to-inject-into-custom-object-classes/6063 "2014-08-12T12:54:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JoshElias](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@JoshElias](https://discuss.emberjs.com/u/JoshElias)
#### Post date: [August 12, 2014, 12:54pm UTC](https://discuss.emberjs.com/t/is-there-an-update-on-how-to-inject-into-custom-object-classes/6063/1 "2014-08-12T12:54:18Z")

</div>

I have a database manager singleton that I create with the following:

```
App.Mongo = Ember.Object.extend({...})

App.register("mongo:main", App.Mongo);
App.inject("route", "mongo", "mongo:main");
App.inject("controller", "mongo", "mongo:main");

```

Now inside that I want to use another singleton:

```
App.Factory = Ember.Object.extend({...})

App.register("factory:main", App.Factory);
App.inject("route", "factory", "factory:main");
App.inject("controller", "factory", "factory:main");
App.inject("object:mongo", "factory", "factory:main");

```

Is there a supported way to accomplish this yet?

---

<div class="post-metadata">

### Author: ![jthoburn](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jthoburn/32/12401_2.png) [@jthoburn](https://discuss.emberjs.com/u/jthoburn)
#### Post date: [October 9, 2014, 7:28am UTC](https://discuss.emberjs.com/t/is-there-an-update-on-how-to-inject-into-custom-object-classes/6063/2 "2014-10-09T07:28:56Z")

</div>

I’d like to know the answer to this as well. I’ve got a factory I’d like to inject my socket and store singletons into. I thought it would be something as simple as:

```auto

Ember.Application.initializer({
    name: "factory",
    after: "socket",

    initialize: function (container, application) {
        container.register('factory:main', Ember.Factory);
         application.inject('factory:main', 'store', 'store:main');
         application.inject('factory:main', 'socket', 'socket:main');
    }
});

```

Where `Ember.Factory = Ember.Object.extend({})`;

However, calling `Ember.Factory.create()` does not result in an object with `store` and `socket` properties.

My factory happens to be something that’s meant to be extended, much like `DS.Model`. My App has `App.FooFactory = Ember.Factory.extend();`. Instances of App.FooFactory also fail to have session and store properties.

I’ve tried several variations on what I register, what I inject upon, and when / how I create the FooFactory instance, but all fail to have `store` or `socket` injected.
