Last active
January 25, 2017 09:44
-
-
Save dupski/1bfa64e0580bab24c83365b75268e20f to your computer and use it in GitHub Desktop.
Typescript Property Decorator factory test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function format(name: string) | |
{ | |
return function(target: Object, propertyKey: string | symbol) { | |
console.log('name:', name, 'factory args', arguments); | |
}; | |
} | |
class Greeter { | |
@format('test') | |
greeting: string; | |
constructor(message: string) { | |
this.greeting = message; | |
} | |
greet() { | |
} | |
} | |
const greet = new Greeter('test'); | |
greet.greet(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment