1

I've tried to change this :

import { SomeService} from '../../../../../service/some-service.service';

to this

import { SomeService} from 'service/some-service.service';

by adding baseUrl and paths in tsconfig.json :

"compilerOptions": {
"baseUrl": "./src",
"paths": {
  "service/*": ["service/*"],
}}

But I got this error

Uncaught Error: Cannot find module 'service/some-service.service' in ....

I know its fine without using paths in tsconfig.json, but it would be nice if I use paths. If anyone could help I would very appreciate.

  • maybe the same question? http://stackoverflow.com/questions/34925992/how-to-avoid-imports-with-very-long-relative-paths-in-angular-2/34926643 – Fernando Del Olmo Nov 20 '16 at 18:01

0 Answers0