Open kayvanbree opened 5 years ago
With the way arguments work since the Angular 18 update it doesn't seem like this is gonna work:
@CtxOption({
label: "Decorator option",
args: () => { this.name; }
})
someMethod(value: string) {
console.log("Using decorator to get " + value);
}
We can not call this
in the same way we would with the normal declaration in a field.
So unless we change how arguments work this is probably not gonna happen.
Is your feature request related to a problem? Please describe. Don't like the way we create context menu items
Describe the solution you'd like Use Decorators to create context items:
Decorator class is something like this:
Biggest problem of this solution is that
this
is not available as you would think. This is probably because the method is passed to the ContextMenuItem and not the class. Maybe we can change it and call it likethis.item.class[this.item.action](this.item.args)
in ContextMenuItemComponent...