InterviewHubPRO
Section Overview
Q99

Question 99 of 283

Part 4: JIT vs AOT Compilation, Metadata & TypeScript (76 - 100)

35%
Angular & Signals (283 Qs)•Part 4: JIT vs AOT Compilation, Metadata & TypeScript (76 - 100)

What is the purpose of common module?

The commonly-needed services, pipes, and directives provided by @angular/common module. Apart from these HttpClientModule is available under @angular/common/http.

Practical Code Example

typescript
// CommonModule: Imports fundamental Angular directives (*ngIf, *ngFor, [ngClass], [ngStyle])
// In standalone components, import CommonModule or individual directives directly:
@Component({
  standalone: true,
  imports: [CommonModule],
  template: `<p *ngIf="show">Visible</p>`
})
export class SampleComponent {}