Typescript introduced decorators, Decorators is a one of a design pattern in an object-oriented program.
Design patterns are solutions to repeated problemsn. This pattern allows adding functions and behavior to objects dynamically. This will not affect the overall behavior of objects of a class.
Typescript decorators can be applied to
These are experimental features, This might change in future versions. This will not be available to code normally.
We have to doCompilerpoiler configurations - experimentalDecorators to enable it.
This can be done via command line or tsconfig.json.
tsc --target ES5 --experimentalDecorators
We will see the decorator examples in future posts Class Decorator and Examples