The TypeScript features in this chapter require TypeScript 1.5 or higher and the following options to be enabled in the tsconfig.json file:
"experimentalDecorators": true, "emitDecoratorMetadata": true
As indicated by the experimental decorators compilation flag, the decorator's API is considered experimental. This doesn't mean that it is not ready for production usage. It means that the decorator API is subject to potential breaking changes in the future.
We are also going to need a polyfill for the reflect–metadata API. We need a polyfill because most JavaScript engines don't support this API yet. We can expect that, in the long term, this polyfill will not be required but, currently, we can use the reflect–metadata npm module:
npm install reflect-metadata
The reflect-metadata version was 0.1.12 at the time of...