My Angular Project Structure looks like this:
My goal is to be able to import the register.component.ts into the auth-routing.module.ts with
import { RegisterComponent } from '@pages/auth/authpages/register/register.component';
For that, i added the path to my tsconfig.json, which looks like this:
"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
}
}
For some reason, it still does not work. The component is properly exported and can be targeted with standard ts paths. Does anyone have a clue whats the problem?
try change this
"@pages/*": ["app/pages*"]
to
"@pages/*": ["app/pages/*"]