Discover the power of decorators in TypeScript
summary
Shows how to create real TypeScript decorators: enable experimentalDecorators in tsconfig, write a decorator factory that returns a function, and use the property descriptor (value) to wrap or replace a method. Demonstrates a parameter decorator (validateCountry) that stores indexes in metadata and a method decorator that checks those args. Builds a small Angular CLI app (Viking demo) that runs and rejects non‑Viking countries.
AI-written summary · about
chapters (8)
- 0:00Start
- 1:45WHAT IS A DECORATOR?
- 2:02TYPES OF DECORATORS AVAILABLE IN TYPESCRIPT
- 2:27CLASS DECORATOR
- 3:36HOW USE CUSTOM DECORATORS ?
- 4:32EVALUATION S EXECUTION PROCESS
- 5:12DECORATOR FACTORY
- 6:26PROPERTY DESCRIPTOR
related talks
48mFalling in love with decorators ES6/TypeScript
17mWrapping it up with Decorators
46mTypeScript Decorators - Higher Order Functions in Disguise
32mDemystifying TypeScript Decorators
21mTypescript meta programming from 0 to 100
22mWrapping It Up with Decorators
27mAdvanced TypeScript: elegant solutions to common problems
21mEnhancing Decorators with Type Annotations: Techniques and Best Practices
