I have this a model
in this path:
/my-project/app/models/my-model.js
And I want to import it from a route
in this path:
/my-project/app/routes/battles/battle/combats/new.js
The import sentence looks like this:
import MyModel from '../../../../models/my-model';
The path is insane, I have to use the try and error system to figure out it. Also if I want to import the same model in another component I can't just copy&paste because this path is only valid from an specific path. For the same reason if I change the path of the component importing my model I have to update the import path.
I would like to have path relative to the root of the project, something like:
import MyModel from '/models/my-model';
Is this possible?
Ember CLI registers everything in app/
under the project name, so the import should look like this:
import MyModel from 'my-project/models/my-model';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With