You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have a look at the tsconfig file is src/tsconfig.app.json (so it is not the tsconfig.json in the root). This is particular to angular-cli (https://cli.angular.io/)
If you look on line 8 in src/app/app.module.ts you can see how I imported the button component. VSCode shows this as an error.
But the project works because of the paths property in the tsconfig.app.json. When you run the project (with the command ng serve) everything is fine.
Maybe Im doing something wrong. Thats possible as well
Anton
TypeScript does not look at tsconfig.app.json only at tsconfig.json from what I know. Maybe tsconfig.app.json is a template for the actual tsconfig.json?
Hi Christof Marti (@chrmarti) , thank you for your reply. As I understood tsconfig.json is only the default name for the file. Using the compiler you can actually specify the name of the file e.g. tsc --project tsconfig.app.json. Since there are multiple config files in the same folder the names need to be different.
Maybe there is a way to tell vscode which file(s) it should use?
the tsconfig.app.json file is not a template. it is used like that by Angular CLI
Anton Karsten (@antonkarsten) Currently you must use the files names tsconfig.json or jsconfig.json. One possible workaround is described here and we are tracking allowing you to specify project config filenames explicitly with #12463
Another workaround you can apply @angular/cli without adding new files is to remove the "baseUrl" property from tsconfig.app.json and tsconfig.spec.json and add to the root tsconfig.json the property "baseUrl": "./src/", as they both extend it and refer to the same directory (tested with @angular/cli@1.4.4).
Activity
chrmarti commentedon Apr 10, 2017
TypeScript does not look at
tsconfig.app.jsononly attsconfig.jsonfrom what I know. Maybetsconfig.app.jsonis a template for the actualtsconfig.json?antonkarsten commentedon Apr 10, 2017
Hi Christof Marti (@chrmarti) , thank you for your reply. As I understood tsconfig.json is only the default name for the file. Using the compiler you can actually specify the name of the file e.g. tsc --project tsconfig.app.json. Since there are multiple config files in the same folder the names need to be different.
Maybe there is a way to tell vscode which file(s) it should use?
the tsconfig.app.json file is not a template. it is used like that by Angular CLI
mjbvz commentedon Apr 10, 2017
Anton Karsten (@antonkarsten) Currently you must use the files names
tsconfig.jsonorjsconfig.json. One possible workaround is described here and we are tracking allowing you to specify project config filenames explicitly with #12463nitzano commentedon Oct 7, 2017
Another workaround you can apply
@angular/cliwithout adding new files is to remove the "baseUrl" property fromtsconfig.app.jsonandtsconfig.spec.jsonand add to the roottsconfig.jsonthe property"baseUrl": "./src/",as they both extend it and refer to the same directory (tested with@angular/cli@1.4.4).