I am working on a project using the PEAN stack and have installed Angular's latest version. I have stored all modules of Angular Material in a file called 'material.module.ts' so that I don't need to import every single module repeatedly in all components. But the Angular Material tags are not working although the code seems fine.
material.module.ts (stored in the folder 'material' and used JUST to import modules, no other purpose and NOT a component) -
login.module.ts ('login' is a component to display a login screen) -
login.component.html -
output in localhost:4200 (can notice that 'mat-button' is not working) -
I cross-checked my package.json file with a GitHub repository I am using for inspiration, and it is fine. Help!







In the provided picture, you have imported LoginComponent, but the component itself is not included in the declarations array. Therefore, it will not be able to utilize imports like LoginRoutingModule or MaterialModule. Is LoginComponent declared in a different module?
For your standalone component without a module.