angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Is there an easy way to do absolute imports (avoid ../../../) with the default generated project?

Open 281330 opened this issue 10 years ago • 4 comments

  1. OS? Windows 8.1
  2. Versions. angular-cli: 1.0.0-beta.10, node: v6

My src folder has the following structure:

app --feature1 --feature2 ----shared ------components --------uniqueComponent1 --shared ----components ------sharedComponent1 ----services main.ts system-config.ts tsconfig.json typings.d.ts

If I am in feature2/shared/components/uniqueComponent1, and I want to import sharedComponent1,

is there a way I can do this without having to do ../../../ many times and instead do something like

import { SharedComponent1 } from 'app/shared/components/sharedComponent1';

Please let me know.

281330 avatar Aug 03 '16 20:08 281330

There will be. See here: #1465

clydin avatar Aug 03 '16 23:08 clydin

@clydin does the typescript paths only work in typescript 2?

281330 avatar Aug 04 '16 21:08 281330

This issue is being tracked in #1465.

filipesilva avatar Aug 15 '16 01:08 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.