🧩 Modules

How NgModules help manage code and complexity

command line
ng generate module cool

Get comfortable with declarations, imports, and exports.

file_type_ng_component_ts some.module.ts
@NgModule({
  // Components defined in this module
  declarations: [
    FooComponent
  ],
  // Components used in this module
  imports: [
    CommonModule
  ],
  // Components that can be imported by other modules
  exports: [
    FooComponent
  ],
})

Questions? Let's chat

Open Discord