W3cubDocs

/Ember.js

ContainerProxyMixin (public)

Defined in: packages/ember-runtime/lib/mixins/container_proxy.js:136
Module: ember

Given a fullName return a factory manager.

This method returns a manager which can be used for introspection of the factory's class or for the creation of factory instances with initial properties. The manager is an object with the following properties:

  • class - The registered or resolved class.
  • create - A function that will create an instance of the class with any dependencies injected.

    For example:

    let owner = Ember.getOwner(otherInstance);
    // the owner is commonly the `applicationInstance`, and can be accessed via
    // an instance initializer.
    
    let factory = owner.factoryFor('service:bespoke');
    
    factory.class;
    // The registered or resolved class. For example when used with an Ember-CLI
    // app, this would be the default export from `app/services/bespoke.js`.
    
    let instance = factory.create({
    someProperty: 'an initial property value'
    });
    // Create an instance with any injections and the passed options as
    // initial properties.

Methods

Properties

No documented items

Events

No documented items

© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://emberjs.com/api/ember/2.14/classes/ContainerProxyMixin