Diving Into Design Metadata with NestJS

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Diving Into Design Metadata with NestJS

Design-time metadata makes it possible to take advantage of features like reflection or dependency injection in JavaScript. Have you ever wondered how it is it possible that either Angular or NestJS automatically resolves relations between your classes? Or how can you access method param types to perform auto-validation of input parameters? Let's have an in-depth look at TypeScript metadata and see what we can achieve using this powerful mechanism.

Kamil Mysliwiec

October 20, 2019

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

92 slides
  1. KAMMYSLIWIEC interface ArgumentMetadata { type: 'body' | 'query' | 'param'

    | 'custom'; metatype?: Type<any>; data?: string; }
  2. KAMMYSLIWIEC @Post() async create( @Body() createDto: CreateRecipeDto, ): Promise<string> {

    return 'This action adds a new recipe'; } TYPE METATYPE DATA
  3. KAMMYSLIWIEC @Post() async create( @Body() createDto: CreateRecipeDto, ): Promise<string> {

    return 'This action adds a new recipe'; } TYPE METATYPE DATA

More Decks by Kamil Mysliwiec

Other Decks in Programming