Suggest an editImprove this articleRefine the answer for “How do you register a directive in a module?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)To register a directive in Angular, you need to add it to the module's `declarations` array (`NgModule`). **Key point:** a module's `declarations` array is where all components, directives and pipes are registered so Angular can recognize them.Shown above the full answer for quick recall.Answer (EN)ImageTo register a directive in Angular, you need to add it to the module's `declarations` array (`NgModule`). Example: ```typescript import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { HighlightDirective } from './highlight.directive'; @NgModule({ declarations: [ AppComponent, HighlightDirective // register the directive here ], imports: [ BrowserModule ], bootstrap: [AppComponent] }) export class AppModule { } ``` After that, the directive becomes **available in all components of this module** and can be applied to elements through its selector. > Conclusion: a module's `declarations` array is where all components, directives and pipes are registered so Angular can recognize them.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.