function buildEngineInstance(EngineClass) {
  let engineInstance = EngineClass.buildInstance();
  setEngineParent(engineInstance, {
    lookup() { return {}; },
    resolveRegistration() { return {}; }
  });
  return engineInstance;
}
Example #2
0
      @private
      @method buildChildEngineInstance
      @param name {String} the registered name of the engine.
      @param options {Object} options provided to the engine instance.
      @return {Ember.EngineInstance,Error}
    */
    buildChildEngineInstance(name, options = {}) {
      let Engine = this.lookup(`engine:${name}`);

      if (!Engine) {
        throw new EmberError(`You attempted to mount the engine '${name}', but it is not registered with its parent.`);
      }

      let engineInstance = Engine.buildInstance(options);

      setEngineParent(engineInstance, this);

      return engineInstance;
    },

    /**
      Clone dependencies shared between an engine instance and its parent.

      @private
      @method cloneParentDependencies
    */
    cloneParentDependencies() {
      let parent = getEngineParent(this);

      [
        'route:basic',
function buildEngineInstance(EngineClass) {
  let engineInstance = EngineClass.buildInstance();
  setEngineParent(engineInstance, {});
  return engineInstance;
}