antonmedv / monkberry

Monkberry is a JavaScript library for building web user interfaces
https://monkberry.js.org
MIT License
1.49k stars 78 forks source link

Support for arrow functions in directives? #16

Open benjamminf opened 8 years ago

benjamminf commented 8 years ago

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>
antonmedv commented 8 years ago

This is cool feature. Already in TODO.

benjamminf commented 8 years ago

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