NgModule and FormModule importing on every module?

According to this NgModule doc it is as intended,

  • so if you are using multiple NgModule heirarchy in your app, you will need to create a SharedModule and import/export all the global Modules/Components/Directives/Pipes in it.

  • then import this module in every Module that you want to share it with.


You can read the docs for more clarification.


You should add FormsModule and ReactiveFormsModule to your SharedModule exports, then you need to import your SharedModule into your other modules. That way, you will be able to use desired directives globally.