annyang icon indicating copy to clipboard operation
annyang copied to clipboard

Pass custom context to commands

Open tartinesKiller opened this issue 8 years ago • 1 comments

After reading the annyang sources, I've seen that the commands are executed in the window context, or in the annyang context. I've moved all the annyang logic in a separate js file, and my commands contains a method call, this.method();. But actually this is undefined.

Expected Behavior

It should be possible to customize the commands context, like what is already done for callbacks.

Maybe there is already a way of doing this, but I didn't find it.

Keep up with the good work ! :)

tartinesKiller avatar Feb 03 '18 15:02 tartinesKiller

What is the status on this? It would be marvelous to attach some context to callback.

lesliepound avatar Jan 31 '22 20:01 lesliepound