title: Passing method to a typescript decorator
body: <p>I am trying to pass a method to a typescript decorator. I am able to do so when I do this as an inline arrow function. But I am not able to do this in the following way:</p>
  <pre><code>function preProcessor(preFn:any) {
      
      return function (
          target: any,
          propertyKey: string,
          descriptor: PropertyDescriptor
      ) {        
          descriptor.value = function (param:any) {
              return preFn(param);
          }
      };
  }
  
  class C {
      @preProcessor(this.capitalize)
      methodA(str: any) {
          console.log(str)    }
  
    capitalize = (x:any)=&gt;{return x.toUpperCase()}
  
  }
  
  var c = new C()
  console.log(c.methodA(&quot;samurai...&quot;))
  </code></pre>
  <p><strong>This works:</strong></p>
  <pre><code>@preProcessor((x:any)=&gt;{return x.toUpperCase()})
  </code></pre>