'Angular Material intellisense doesn't work in VSCode
I'm working on an Angular
(v13) project and I installed Angular
Material
using this command
ng add @angular/material
I can see the package in the node_modules, but in VSCode
, the intellisense/auto-import don't work at all for a typescript
file, but it works with any other package.
It's not the first time I'm having this issue with Angular
Material
, but I never found a solution.
Solution 1:[1]
I ran into the same issue just now on V13. Adding the following line to tsconfig.json
fixed it for me (goes under "compilerOptions"):
"typeRoots": ["node_modules/@angular/material"]
Solution 2:[2]
Not sure if this will help, but you can try using an extension like (Angular Language Service) available here https://marketplace.visualstudio.com/items?itemName=Angular.ng-template
Solution 3:[3]
ok I've found the issue. To have the intellisense working, I had to import the material module
in my angular module
, then I can see the intellisense in the component
code.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Rikku121 |
Solution 2 | Apurwa Anand |
Solution 3 | J-R Choiniere |