0Pricing
TypeScript Academy · Lesson

Decorators in TypeScript

Discover how decorators add metadata to your code and simplify development in frameworks like Angular.

1

Introduction to Decorators

Decorators in TypeScript are special functions that allow you to add metadata or modify the behavior of classes, methods, and properties.

They are often used in frameworks like Angular to simplify development.

Decorators in TypeScript — illustration 1

2

How Decorators Work

A decorator is a function that is applied to a class or its members (methods, properties, etc.).

For example, @Component in Angular is a decorator that adds metadata to a class to define it as a component.

All lessons in this course

  1. Type Inference and Contextual Typing
  2. Decorators in TypeScript
  3. TypeScript Modules and Namespaces
← Back to TypeScript Academy