Property Decorators
Property decorators work with properties of classes.
The above example must be compiled with both the --experimentalDecorators
and --emitDecoratorMetadata
flags.
In this case the decorated property is replaced by the label
passed to the decorator. It's important to note that property values cannot be directly manipulated by the decorator; instead an accessor is used.
Here's a classic property example that uses a plain decorator
In this case the name property is not writable
, and remains undefined.
Last updated