My goal is to implement the following syntax:
@Controller('/user')
class UserController {
@Action('/')
get() {
}
}
Now in the definition of decorators:
function Controller (options) {
return function(target: any) {
let id = generateUniqueId();
target.__id = id;
addToSet(id, target)
}
}
function Action (options) {
return function (target: any, propertyKey: string) {
//I need to retrieve the __id set in its class
}
}
How can I access the unique id that I am assigning in the controller?