This is 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 { }
Please note that I added to Imports
only CommonModule
and IconModule
. I did it because I'm using those modules in my RequiredActionDirective
. But Exports
has more Modules because will be used by other modules that will import SharedModule
.
Question: am I thinking correctly that I don't need to add Modules to Imports
unless I want to use them directly in SharedModule
? Or in future there might be some problems of which I am currently not aware because now everything is working properly?