nin*_*dev 3 typescript angular angular5
有没有办法在 Angular 5 中为自定义路径使用命名空间?目前我使用
import { AuthService } from './../../modules/auth/auth.service';
Run Code Online (Sandbox Code Playgroud)
我想要实现的是使用@module或自定义@name特定路径。代码应如下所示,可用于每个文件夹级别
import { AuthService } from '@modules/auth/auth.service';
Run Code Online (Sandbox Code Playgroud)
是的,配置中有paths属性tsconfig.json:
{
...
"compilerOptions": {
...
"paths": {
"@core/*": ["app/core/*"],
"@shared/*": ["app/shared/*"]
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
647 次 |
| 最近记录: |