My question is: How can I import modules from Angular material in my own module, and then import that module in app.module.ts?.
This is my personal module:
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatMenuModule } from '@angular/material/menu';
import { MatButtonModule } from '@angular/material/button';
@NgModule({
imports: [
BrowserAnimationsModule,
MatMenuModule,
MatButtonModule
],
declarations: [
]
})
export class MaterialModule { }
whereupon what I do is the following in app.module.ts:
import {MaterialModule} from './material.module';
imports array:
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
FormsModule,
MaterialModule
],
The fact is that I get errors, but if I do it directly everything in app.module.ts works for me. I do not want to have everything imported in the same module, so as not to make it difficult when reviewing, or correcting code. Thanks in advance, greetings.