Typescript annotations

14,493

No there isn't.

Check out this article Decorators & metadata reflection in TypeScript. It shows how decorators are transformed into pure javascript and therefore when they are called.

Share:
14,493
Illorian
Author by

Illorian

Updated on June 04, 2022

Comments

  • Illorian
    Illorian about 2 years

    I am writing project on MarionetteJS using TS and I want to use annotations to register routes. For example:

    @Controller
    class SomeController {
    
      @RouteMapping("some route")
      public SomeMethod() {
         //code
      }
    }
    

    Is there opportunity to call method annotations when I create class instance?

  • Illorian
    Illorian almost 5 years
    Nice but this library is for node.js =)