Welcome to my SharedModule!
import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { IconModule } from "@my-app/components/icon/icon.module";
import { RequiredActionDirective } from "@my-app/directives/required-action.directive";
@NgModule({
imports: [
CommonModule,
IconModule
],
declarations: [
RequiredActionDirective
],
exports: [
CommonModule,
IconModule,
FormsModule,
ReactiveFormsModule,
RequiredActionDirective
]
})
export class SharedModule { }
I made the decision to include only CommonModule
and IconModule
in the Imports section because they are directly used in the RequiredActionDirective. However, I included more modules in the Exports section as they may be needed by other modules importing SharedModule.
It raises the question: is it correct that I do not have to add Modules to Imports unless directly using them in SharedModule? Could there potentially be unforeseen issues in the future despite everything working smoothly now?