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.
SubscribeRelated
@ComponenttemplateUrlstyleUrlselectortemplatestylesimportscomponent