TypeScript

Decorators (TypeScript)

Në shqip: Dekoratorët në TypeScript

ShpjegimiSQ

Dekoratorët janë funksione me @ që vendosen mbi klasa, metoda ose fusha dhe u shtojnë sjellje — si @Component në Angular ose @Controller në NestJS. Ngjajnë me anotacionet e Java-s.

EnglishEN

Decorators are @ functions placed on classes, methods or fields that add behaviour — like @Component in Angular or @Controller in NestJS. They're similar to Java annotations.

Si ta mendosh

Si ngjitëset në pakot e postës që ndryshojnë si trajtohen.

Lexoje në anglisht

Like stickers on parcels that change how they're handled.

Shembull koditypescript

@Controller("terma")
class TermaController {
  @Get(":id") merr(@Param("id") id: string) { /* ... */ }
}

Terma të lidhur