I'm relatively new to Angular and I am encountering some difficulties when trying to export a material module. The error message that appears is as follows:
(Failed to compile.) ./src/app/app.module.ts 17:12-30 "export 'MaterialComponents' was not found in './material/material.module'
Below is the code for the Material Module:
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
const MaterialComponents = [
MatButtonModule
];
@NgModule({
exports: [MaterialComponents],
imports: [MaterialComponents],
})
export class MaterialModule { }
Now, let's take a look at the App Module:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialComponents } from './material/material.module';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
MaterialComponents
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }