-
Notifications
You must be signed in to change notification settings - Fork 12.8k
@angular/material no import suggestions #29009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Upon further investigation, if I don't scope the module down as far Which makes sense and aligns with the comment in the related issue. I guess not having the suggestions show up the first time threw me off. |
This should be reopened. Those were workarounds for the real problem. Angular material now has a different way to load modules. You can't import Modules should be suggested for |
Ok. Finally, after writing the problem down and reading my comment above, I've realized that there's this option: After setting this to |
This didn't work for me even if have non-relative setting. |
For Angular 13, below solution worked for me:
|
hi, this work for me but i got an error like this
how can i fix this ? |
@erwindelta same here, anyone got how to solve this ? |
I am using Angular 15, ES2022 here is the error that I got:
Any fixes? |
This plus non-relative solved my issue, thanks bro!
|
A colleague of mine got the solution for me. In my case with VS-Code and Angular 15 for the same issue @mratanusarkar had. Without the Worked for me, thanks to @i3ene |
Expected behavior:
When typing in angular material imports, I should receive auto import suggestions and a light bulb.
Actual behavior:
Not receiving any import suggestions or light bulb.
Steps to reproduce:
Start a new angular project
ng new mat-test --style=scss --routing
Add angular material
ng add @angular/material
Y to hammerjs
Y to animations
Open app.module.ts
In the imports array, start typing MatButtonModule, notice there is no suggestions.
If I add the import correctly
import { MatButtonModule } from '@angular/material/button';
which in the similiar issue below suggested would fix this, it actually does not.I start typing MatSidenavModule in the imports array and it again fails to pick up this import.
Related Issues:
#28773
There are two comments of interest in this issue, one mentions adding an import from the module will resolve this as ts will then start searching there. This does no work, as demonstrated above by adding a module from button, the other modules do not work.
The other comment mentions that this works correctly in TS 3.2.1. I fail to see how this works correctly, or maybe the solution to this has not been explained?
I've tested this in Typescript 3.3.0-dev, 3.2.2 and 3.1.6, same behaviour in all 3.
Using VS Code 1.30.0
The text was updated successfully, but these errors were encountered: