0

Sometimes I have to specify the full path to another service/component based on current component location like:

import {LocalService} from '../../../_services/LocaleService';

To agree that it is not convenient.

How to shorten this path to more beauty and elegant?

2

1 Answer 1

0

This may be a matter of style. Consider restructuring your application to follow the LIFT principle such that you can Locate code quickly, Identify the code at a glance, keep the Flattest structure you can, and Try to be DRY.

To keep the folder structure as flat as possible, take advantage of splitting your application into modules and utilize folders by feature.

Take a look here for a good example of folder structure.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.