vendredi 28 février 2020

Inject value in parameter of method when executing it

How can a value be dynamically injected for a method parameter? Example:

class A {

  method(@timeStamp() when: string): void {
    console.log(when); // Should output when was the method executed
  }

}




Aucun commentaire:

Enregistrer un commentaire