I\'m using the latest Angular CLI, and I\'ve created a custom components folder which is a collection of all components.
For example, TextInputComponent
Above all answer correct, but after struggling by searching over internet n trying to understand what exactly problem and trying different troubleshooting option, I came to know baseUrl and Path how works toghether
If you use baseUrl:"." like below it works in VScode but not while compiling
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": ".",
"paths": {
"@myproject/*": ["src/app/*"]
}
}
As per my understanding and my working app and checked in angular aio code, I suggest use as baseUrl:"src" like below
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"paths": {
"@myproject/*": ["app/*"],
"testing/*": ["testing/*"]
}
}
By having base url as source(src directory), compiler properly resolves modules.
I hope this helps to people resolve this kind of issue.