To enable decorators in TypeScript, developers first have to enable the option of experimentalDecorators via command line or tsconfig.json.

Here is the command line to use.
  • $tsc --target ES5 --experimentalDecorators
  • For tsconfig.json, use the following syntax.
    {
       "compilerOptions": {
          "target": "ES5",
          "experimentalDecorators": true
       }
    }

Suggest An Answer

No suggestions avaliable!