2017-01-06 23 views
5

Angular CLI kullanıyorum. gibi bir şey içinKöşeli uçta uzun bir yol için "takma ad" nasıl oluşturulur?

import {AppConfig, AppConfigInterface} from '../../../app.config'; 

:: Nasıl bir yol dönüştürebilirim

import {AppConfig, AppConfigInterface} from 'root/app.config'; 
+6

Olası kopyası [Açısal CLI'de göreceli yollardan kaçınma] (http://stackoverflow.com/questions/41460810/avoiding-relative-paths-in-angular-cli) – jonrsharpe

cevap

3

tsconfig.json bu deneyin:

{ 
 
    "compileOnSave": false, 
 
    "compilerOptions": { 
 
    "outDir": "./dist/out-tsc", 
 
    "sourceMap": true, 
 
    "declaration": false, 
 
    "moduleResolution": "node", 
 
    "emitDecoratorMetadata": true, 
 
    "experimentalDecorators": true, 
 
    "target": "es5", 
 
    "typeRoots": [ 
 
     "node_modules/@types" 
 
    ], 
 
    "lib": [ 
 
     "es2017", 
 
     "dom" 
 
    ], 
 
    "paths": { 
 
     "@services/*": ["app/services/*"] // here! 
 
    } 
 
    } 
 
}

0

açısal cli varsayılan modülleri dizin '/app.config' deneyebilirsiniz /angular-cli.json tanımlanır Eğer kök gerekirse

İlgili konular