Parameter Decorator

by Krishna Ananthi

TypeScript

function LogPos(target: any, propertyKey: string, index: number) {
  console.log('here come decorator',index,propertyKey,target);

}
class Cow {
   say(a: string, @LogPos b: boolean) {
    console.log('hello pos',b);
  }
  
}


new Cow().say('hi chellam',false);