How to implement a typescript decorator? is a good example about how to use decorator in typescript.
Considering the below case,
class MyClass {
You can't access to a object property from a attribute definition.
Decorator is called when the property is defined.
You could use getter or setter to get control when access to the property.