Quick take on Angular Imports

Quick take on Angular Imports

Good morning ☕!

A quick take that I'd like to share before I forget it.

What?

Working in Angular with many packages, sometimes VSCode doesn't "see" a new package and we've just installed and forces us to import it manually to get the IntelliSense for that module.

Why?

That's because Angular CLI adds a property in the "tsconfig.app.json" under "compilerOptions" called "types". Typescript documentation says: "If types is specified, only packages listed will be included in the global scope."

It means that since it's specified in our tsconfig.app.json it will overwrite all other typings that typescript may find in our node_modules folder.

How?

Just remove it, and Typescript will get every typing in our node_modules folder.

Thanks to maximedasilva for finding this out!