I have this model along this path:
/my-project/app/models/my-model.js
And I want to import it from route along this path:
/my-project/app/routes/battles/battle/combats/new.js
The import proposal is as follows:
import MyModel from '../../../../models/my-model';
The way is crazy, I have to use a system of attempts and errors to find out. Also, if I want to import the same model into another component, I canβt just copy and paste, because this path is only valid for a specific path. For the same reason, if I change the path to the component importing my model, I need to update the import path.
I would like to have a path relative to the project root, for example:
import MyModel from '/models/my-model';
Is it possible?
source share