Package @ember/owner


Ember’s dependency injection system is built on the idea of an "owner": an object responsible for managing items which can be registered and looked up with the system.

This module does not provide any concrete instances of owners. Instead, it defines the core type, Owner, which specifies the public API contract for an owner. The primary concrete implementations of Owner are EngineInstance, from @ember/engine/instance, and its ApplicationInstance subclass, from @ember/application/instance.

Along with Owner itself, this module provides a number of supporting types related to Ember's DI system:

  • Factory, Ember's primary interface for something which can create class instances registered with the DI system.

  • FactoryManager, an interface for inspecting a Factory's class.

  • Resolver, an interface defining the contract for the object responsible for mapping string names to the corresponding classes. For example, when you write @service('session'), a resolver is responsible to map that back to the Session service class in your codebase. Normally, this is handled for you automatically with ember-resolver, which is the main implementor of this interface.

For more details on each, see their per-item docs.