monkberry icon indicating copy to clipboard operation
monkberry copied to clipboard

Support for arrow functions in directives?

Open benjamminf opened this issue 8 years ago • 2 comments

Currently calling a method in a directive requires having to re-bind the context, which is a little redundant.

<button :onclick={{ this.method.bind(this) }}>Run method</button>

It'd be nice if it could support arrow functions, and allow for accessing arguments too (like an event object):

<button :onclick={{ e => this.method(e) }}>Run method</button>

benjamminf avatar Jul 08 '16 08:07 benjamminf

This is cool feature. Already in TODO.

antonmedv avatar Jul 08 '16 08:07 antonmedv

Ah my bad, didn't see the TODO list. Looking forward to it :+1:

benjamminf avatar Jul 08 '16 09:07 benjamminf