Explain Decorators in Typescript? List type of Decorators available in Typescript?

devquora
devquora

Posted On: Feb 22, 2018

 

Decorators are function that supports annotating or modifying classes its members.Its allow way to add both annotations and a meta-programming syntax for class declarations and members. Decorators are an experimental feature of Typescript and maybe change in future releases.

You can enable Decorators using the command line or editing your tsconfig.json

Enabling Decorators in TypeScript via command line

tsc --target ES5 --experimentalDecorators

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Typescript Interview Questions

    What is Typescript?

    Typescript is a free and open-source programming language which is designed and developed by Microsoft. It was designed ..

    Typescript Interview Questions

    List some features of Typescript?

    Features of Typescript are:- Typescript can be compiled to all major versions of Javascript(ES3,ES5,ES6,ES7). Typescrip..

    Typescript Interview Questions

    List some benefits of using Typescript?

    Following are some benefits of using Typescript One of the biggest advantages of Typescript is its code completion and ..