jeudi 7 septembre 2017

Import model from inside ember-engine

I have an Ember.js application with an ember-engine added as an external addon, and both the parent application and the engine share the store. This creates an issue because when fetching a model in a route from the engine, the fact of having the store shared makes the parent application to crash saying that it does not know the model.

Copying the model from inside the engine into the parent's models fixes it, but it goes against the principle of isolation.

I wonder if there is any way of importing an engine's model into the parent application, because even if that also makes the parent aware of the engine's model, at least it won't be replicating code.

Since it is an addon, I supposed this would work:

`import DockerComposeModel from 'ember-stack-builder-engine/models/docker-compose'`

But throws an error

Error: Could not find module `ember-stack-builder-engine/models/docker-compose` imported from `bde-integrator-user-interface/application/controller`




Aucun commentaire:

Enregistrer un commentaire