TIL I can use click.capture to add content to the $event object click.capture="$event['someVar'] = data"
then with… click.delegate="someFunc($event)"
someFunc can access “someVar” on the event parameter! (As long as the .capture is on a bubbled container)
Simplistic example, but this creates some very interesting capabilities!
That looks ninja. Maybe, too ninja? I can see myself scratching a hole into my temple looking at that $event object in the view model thinking, where the heck did someVarproperty come from?
A ninja practices one move at a time… until it is done as part of a dance of many…
In my code, I’m using a function to namespace those variables on $event, and it’ll eventually be abstracted a step up further and only added to elements during code execution/template generation.
I’m working towards a multi-touch command/event dispatcher. I’m not just concerned about what data is, but what it’s representing; so separating those calls out to their respective elements makes it cleaner (to my eyes at least).