Skip to content
masterclass Buddy

Angular · Decorator

@Component

@Component marks a TypeScript class as an Angular component. Its metadata defines the selector, rendered template, and optional styles.

Last updated

Syntax

@Component({ selector: string, template?: string, templateUrl?: string, styles?: string | string[], styleUrl?: string, imports?: Array<any> })
export class ComponentName {}

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • @Component
  • templateUrl
  • styleUrl
  • selector
  • template
  • styles
  • imports
  • component

Source: Component • Angular. Checked 2026-11-03.