我的Angular项目结构如下:
我的目标是能够使用]将register.component.ts导入auth-routing.module.ts中。
import { RegisterComponent } from '@pages/auth/authpages/register/register.component';
为此,我将路径添加到了tsconfig.json,如下所示:
"compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "downlevelIteration": true, "experimentalDecorators": true, "module": "esnext", "moduleResolution": "node", "typeRoots": ["node_modules/@types"], "importHelpers": true, "target": "es2015", "lib": [ "es2018", "dom" ], "baseUrl": "src", "paths": { "@pages/*": ["app/pages*"] } }, "angularCompilerOptions": { "fullTemplateTypeCheck": true, "strictInjectionParameters": true } }
出于某种原因,它仍然无法正常工作。该组件已正确导出,可以使用标准ts路径作为目标。有人知道出什么问题吗?
我的Angular项目结构如下:我的目标是能够从'@ pages / auth / authpages / ...中使用import {RegisterComponent}将register.component.ts导入auth-routing.module.ts中。
尝试更改此