title: Adding decorators to dynamically created functions in typescript
body: <p>I am creating dynamic functions in typescript. On these dynamic functions, I want to add decorators. What is the best way to achieve this scenario? Is this a possibility?</p>
  
  <p>Eg - Want to achieve something like this</p>
  
  <pre><code>@decorator1
  @decorator2
  var dynamicFunction = new Function('a', 'b', 'return a + b');
  alert(dynamicFunction(2, 3));
  </code></pre>
  
  <p>Also, if I am creating multiple dynamic functions, how do I add decorators on them?</p>
  
  <p>eg.</p>
  
  <pre><code>var dynamicFunction:Array&lt;Functions&gt;; 
  for (i=0; i&lt;10; i++){
  @decorator1
  @decorator2
  dynamicFunction[i] = new Function('a','b','return a+b');
  }
  </code></pre>