I am facing an issue while trying to include machine detail and a button bar in my app. Interestingly, this setup has worked perfectly fine in other parts of the application but is causing errors in the core module.
main.ts
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
Core Module (error occurs when adding "IfaButtonModule" or "MachineModule")
@NgModule({
declarations: [
TakePhotoComponent,
ConfirmationDialogComponent,
ShareMachineComponent,
NotificationsComponent,
],
imports: [
CommonModule,
WebcamModule,
MatButtonModule,
TranslateModule,
MatDialogModule,
MatFormFieldModule,
MatInputModule,
ReactiveFormsModule,
MatIconModule,
MatExpansionModule,
MatBadgeModule,
MatCardModule,
MatMenuModule,
IfaButtonModule,
MachineModule
],
exports: [
TakePhotoComponent,
ConfirmationDialogComponent,
ShareMachineComponent,
NotificationsComponent
],
providers: [NgxImageCompressService]
})
export class CoreModule { }
Button-Module
@NgModule({
declarations: [
IfaButtonBarItemComponent,
IfaButtonBarComponent,
IfaButtonBarGroupComponent
],
imports: [
CommonModule,
CoreModule,
MatButtonModule,
TranslateModule
],
exports: [
IfaButtonBarComponent,
IfaButtonBarGroupComponent,
IfaButtonBarItemComponent
]
})
export class IfaButtonModule { }
Machine Module
@NgModule({
declarations: [
MachineListComponent,
MachineDetailEditComponent,
MachineDetailComponent,
MachineListItemComponent
],
imports: [
CommonModule,
CoreModule,
MatCardModule,
MatMenuModule,
MatListModule,
MatButtonModule,
FormsModule,
ReactiveFormsModule,
NgxPaginationModule,
MatFormFieldModule,
MatInputModule,
TranslateModule,
MatDialogModule,
MatExpansionModule,
IfaButtonModule,
OperationModeModule,
ProtectionModule,
ManipulationModule
],
exports: [
MatMenuModule,
MachineDetailEditComponent,
MachineListComponent,
MachineDetailComponent
]
})
export class MachineModule {
}
The HTML snippet utilizing these components (within the Core Module section):
<ng-container>
<app-machine-detail [machine]="completeMachine">
</app-machine-detail>
<app-ifa-button-bar-group>
<app-ifa-button-bar-item [label]="'MISC.BACK'" (click)="navigateBack()">
</app-ifa-button-bar-item>
</app-ifa-button-bar-group>
</ng-container>